PSoC™ 6 Forum Discussions
text.format{('custom.tabs.no.results')}
Hi,
I am trying to create a project based on the https://github.com/Infineon/mtb-example-psoc6-security/tree/release-v1.0.0 project. So far I used the CY8CPROTO-062-4343W evalboard and everything was fine. I was able to build a bootloader and application, upload it to the hardware, etc.
The problem arose when I wanted to do the same on a custom BSP. As per https://www.infineon.com/dgdl/Infineon-ModusToolbox_2.4_User_Guide-UserManual-v01_00-EN.pdf?fileId=8ac78c8c7e7124d1017ed97e72563632 section 4.3 Creating your own BSP, I created a target using 'make bsp TARGET_GEN = myBSP DEVICE_GEN = CY8C6247FDI-D32' and went through all the steps.
In bootloader https://github.com/Infineon/mtb-example-psoc6-security/blob/release-v1.0.0/bootloader_cm0p/source/main.c#L45 I changed references to "cybsp.h" and changed init_cycfg_all () to cybsp_init (), no problem with that.
There is a problem with the MCUBoot library. The build logs (at the bottom of the post) show that for some reason the file mtb_shared\mcuboot\v1.7.2-cypress\boot\cypress\libs\cy-mbedtls-acceleration\mbedtls_MXCRYPTO\crypto_common.h with the declaration of the type cy_en_crypto_ecc_curve_id_t is not included. The same is true for a few other files.
If I only change TARGET=CY8CPROTO-062-4343W then everything compiles and the bootloader works on the board.
Additional information is the fact that all files related to the bootloader folder itself along with main.c have been compiled, and the problem appears later while MCUBoot is compiling.
What might be missing from my setup?
Best regards,
PZbb
Compiling ext file swap_move.c
In file included from ../../mtb_shared/mcuboot/v1.7.2-cypress/ext/mbedtls/crypto/include/mbedtls/ecp.h:267,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/ext/mbedtls/crypto/include/mbedtls/pk.h:41,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/ext/mbedtls/crypto/include/mbedtls/oid.h:34,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/boot/bootutil/src/image_ec256.c:40:
../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/ecp_alt.h:175:1: error: unknown type name 'cy_en_crypto_ecc_curve_id_t'
175 | cy_en_crypto_ecc_curve_id_t cy_get_dp_idx(mbedtls_ecp_group_id gid);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [libs/core-make/make/core/build.mk:387: /user/project/bootloader_cm0p/build/myBSP/Custom/ext/mtb_shared/mcuboot/v1.7.2-cypress/boot/bootutil/src/image_ec256.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from ../../mtb_shared/mcuboot/v1.7.2-cypress/ext/mbedtls/crypto/include/mbedtls/ecp.h:267,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/crypto_common.h:36,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/sha256_alt.h:38,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/ext/mbedtls/crypto/include/mbedtls/sha256.h:69,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/boot/bootutil/include/bootutil/crypto/sha256.h:29,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/boot/bootutil/src/image_validate.c:36:
../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/ecp_alt.h:175:1: error: unknown type name 'cy_en_crypto_ecc_curve_id_t'
175 | cy_en_crypto_ecc_curve_id_t cy_get_dp_idx(mbedtls_ecp_group_id gid);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/sha256_alt.h:38,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/ext/mbedtls/crypto/include/mbedtls/sha256.h:69,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/boot/bootutil/include/bootutil/crypto/sha256.h:29,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/boot/bootutil/src/image_validate.c:36:
../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/crypto_common.h:112:43: error: unknown type name 'cy_stc_crypto_sha_state_t'
112 | int cy_hw_sha_start (cy_hw_crypto_t *obj, cy_stc_crypto_sha_state_t *hashState,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/crypto_common.h:113:22: error: unknown type name 'cy_en_crypto_sha_mode_t'
113 | cy_en_crypto_sha_mode_t shaMode, void *shaBuffers);
| ^~~~~~~~~~~~~~~~~~~~~~~
../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/crypto_common.h:115:43: error: unknown type name 'cy_stc_crypto_sha_state_t'
115 | int cy_hw_sha_update(cy_hw_crypto_t *obj, cy_stc_crypto_sha_state_t *hashState,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/crypto_common.h:118:43: error: unknown type name 'cy_stc_crypto_sha_state_t'
118 | int cy_hw_sha_finish(cy_hw_crypto_t *obj, cy_stc_crypto_sha_state_t *hashState,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/crypto_common.h:122:22: error: unknown type name 'cy_stc_crypto_sha_state_t'
122 | cy_stc_crypto_sha_state_t *hashStateDst, void *shaBuffersDst);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/crypto_common.h:124:44: error: unknown type name 'cy_stc_crypto_sha_state_t'
124 | int cy_hw_sha_process(cy_hw_crypto_t *obj, cy_stc_crypto_sha_state_t *hashState,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../mtb_shared/mcuboot/v1.7.2-cypress/ext/mbedtls/crypto/include/mbedtls/sha256.h:69,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/boot/bootutil/include/bootutil/crypto/sha256.h:29,
from ../../mtb_shared/mcuboot/v1.7.2-cypress/boot/bootutil/src/image_validate.c:36:
../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/sha256_alt.h:44:5: error: unknown type name 'cy_stc_crypto_sha_state_t'
44 | cy_stc_crypto_sha_state_t hashState; /* Structure used by CY Crypto Driver */
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../../mtb_shared/mcuboot/v1.7.2-cypress/boot/cypress/libs/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/sha256_alt.h:48:5: error: unknown type name 'cy_stc_crypto_v2_sha256_buffers_t'
48 | cy_stc_crypto_v2_sha256_buffers_t shaBuffers; /* Structure used by CY Crypto Driver */
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi,
I have a tight time requirement from POR to CM4 image in CY8CPROTO-064B0S.
Then, I want to know if I can disable secure boot in CY8CPROTO-064B0S such like by adjusting policy files.
Is it possible?
Thanks,
Show Less
Hello, World!
I have a PSoC 6 project with one working SPI block and need to create a second. At least I think I do (one chip uses CPHA=1, CPOL=0 and the other uses CPHA=0, CPOL=0). When I add the second SPI block, I get the following:
Elaborating Design...
HDL Generation...
Synthesis...
Tech Mapping...
Info: plm.M0038: The pin named CY_CPUSS_SWJ_SWCLK_TCLK(0) at location P6[7] prevents usage of special purposes: SCB[6].uart_cts. (App=cydsfit)
Info: plm.M0038: The pin named CY_CPUSS_SWJ_SWCLK_TCLK(0) at location P6[7] prevents usage of special purposes: SCB[6].spi_select[0]. (App=cydsfit)
Info: plm.M0038: The pin named CY_CPUSS_SWJ_SWCLK_TCLK(0) at location P6[7] prevents usage of special purposes: SCB[8].spi_select[0]. (App=cydsfit)
Info: plm.M0038: The pin named CY_CPUSS_SWJ_SWDIO_TMS(0) at location P6[6] prevents usage of special purposes: SCB[6].uart_rts. (App=cydsfit)
Info: plm.M0038: The pin named CY_CPUSS_SWJ_SWDIO_TMS(0) at location P6[6] prevents usage of special purposes: SCB[6].spi_clk. (App=cydsfit)
Info: plm.M0038: The pin named CY_CPUSS_SWJ_SWDIO_TMS(0) at location P6[6] prevents usage of special purposes: SCB[8].spi_clk. (App=cydsfit)
Analog Placement...
Error: fit.M0059: FFB and IO placement failed: Failed to find a valid placement for \SPI_2:SCB\. (App=cydsfit)
Dependency Generation...
Cleanup...
Error: fit.M0050: The fitter aborted due to errors, please address all errors and rebuild. (App=cydsfit)
--------------- Rebuild Failed: 11/30/2022 00:22:46 ---------------
I think the problem is rooted in the info messages, but I am still a noob and don't really understand what's going on.
I am using a Pioneer board and have 1 x I2C, 2 x SPI, and some analogs. I tried to choose pins that I can get at from the Pioneer's headers.
I2C_1:scl P6[0] pin K8
I2C_1:sda P6[1] pin J8
SPI_1:miso_m P12[1] pin B4
SPI_1:sclk_m P12[2] pin C4
SPI_1:s0_m P12[3] pin A3
SPI_2:miso_m P5[1] pin K6
SPI_2:mosi_m P5[0] pin L6
SPI_2:sclk_m P5[2] pin J6
SPI_2:s0_m P5[3] pin K7
UART:rx P11[0] F5
UART:tx P11[1] E5
AIN0 P10[0] B8
...
AIN5 P10[5] B7
I am using P6[0] and P6[1] but not P6[7] or P6[6]. Can I not use anything on P6?
In a nutshell, I'm trying to use as many of the Arduino header pins as I can but am willing to connect to any pin that makes the project work.
Any thoughts?
Thanks in advance!
Peter
Show Less
Hi there!
I'm using the CYBLE-416045 module & PSoC Creator to implement the "CE218553 - PSoC 6 MCU: PWM
Triggering a DMA Channel" project example. Specifically I'm trying to use the CM0 processor instead of the default CM4.
On the CM4, which the example project defaults to, everything works fine. (see attached screenshot)
But once I move the code from the CM4 to the CM0, then the Timer output stays Low and the Compare never triggers. However Overflow does trigger, indicating that the Timer is still running. Presumably the Compare value is not being changed by DMA for some reason, which is why the timer compare isn't happening. (see attached screenshot)
Is the CM0 processor capable of handling DMA?
Is there something special that needs to happen for DMA to run on the CM0 processor?
Let me know if there's any additional information that I can provide to help troubleshoot this problem.
#include "project.h"
#define ARRAY_SIZE (256u)
#define BREATHING_CHANGE (512u)
uint32 compareVal[ARRAY_SIZE];
void arrayInit(void);
int main(void)
{
cy_stc_dma_channel_config_t channelConfig;
__enable_irq(); /* Enable global interrupts. */
Cy_SysEnableCM4(CY_CORTEX_M4_APPL_ADDR);
arrayInit(); /*initialize the compareVal array */
/* Initialize, enable and trigger the PWM */
Cy_TCPWM_PWM_Init( PWM_HW, PWM_TCPWM__CNT_IDX, &PWM_config);
Cy_TCPWM_Enable_Multiple(PWM_HW, PWM_CNT_MASK);
Cy_TCPWM_TriggerStart( PWM_HW, PWM_CNT_MASK);
/* Configure DMA Descriptor to change the PWM compare value per breathingLed array */
DMA_Descriptor_1_config.srcAddress = &compareVal;
DMA_Descriptor_1_config.dstAddress = (void *) &(PWM_HW->CNT[PWM_TCPWM__CNT_IDX].CC);
Cy_DMA_Descriptor_Init(&DMA_Descriptor_1, &DMA_Descriptor_1_config);
/* Configure DMA Channel with the descriptor configured above */
channelConfig.descriptor = &DMA_Descriptor_1;
channelConfig.preemptable = DMA_PREEMPTABLE;
channelConfig.priority = DMA_PRIORITY;
channelConfig.enable = 0u;
Cy_DMA_Channel_Init( DMA_DW__BLOCK_HW, DMA_DW_CHANNEL, &channelConfig);
Cy_DMA_Channel_Enable(DMA_DW__BLOCK_HW, DMA_DW__CHANNEL_NUMBER);
/* Enable DMA hardware block */
Cy_DMA_Enable(DMA_DW__BLOCK_HW);
Cy_SysEnableCM4(CY_CORTEX_M4_APPL_ADDR);
for(;;)
{
}
}
void arrayInit(void)
{
uint32_t i=0u;
/* Creating the array with increasing and decreasing compare value to generate the breathing */
compareVal[i] = 0;
for(i=0u; i < ARRAY_SIZE>>1; i++)
{
/* Increase compare values */
compareVal[i] = compareVal[i-1u] + BREATHING_CHANGE;
}
for(i=(ARRAY_SIZE>>1); i < ARRAY_SIZE; i++)
{
/* Decrease compare value */
compareVal[i] = compareVal[i-1] - BREATHING_CHANGE;
}
}
Show Less
In working on migrating a project to the newer Anycloud MQTT Client project, I noticed that when I published messages to the client, the MQTT broker would close the TCP/IP socket, thus disconnecting from the client. This is caused by the client not sending a PINGREQ in the allotted MQTT_KEEP_ALIVE_SECONDS time and the MQTT broker assumes the client no longer exists.
I would expect the client to stay connected regardless of Quality of Service, but the broker disconnects occur with QoS of 0. I have yet to see a disconnect when publishing to the client with a QoS of 1.
While this issues exists with version 4.0.0 of the demo project and with the ModusToolbox v2.4.0 toolset, it is reproducible with the latest version of the demo project and version 3.0.0 of ModusToolbox.
To duplicate the issue:
- Create the project as in the Readme.md: project-creator-cli --board-id CY8CKIT-062S2-43012 --app-id mtb-example-wifi-mqtt-client --user-app-name MQTTClient --target-dir .
- Modify config/wifi_config.h to local router
- Modify config/mqtt_client_config.h to local Mosquitto broker (ensures only local traffic) and MQTT_KEEP_ALIVE_SECONDS to 5 (reveals issue faster).
- make build -j8; make program
- Publish to client: mosquitto_pub -h 192.168.4.2 -t "ledstatus" -m "0123456" -q 0
There isn't a disconnect every time publishing to the client with QoS of 0, but I've attached client output, the mosquitto broker log, and a Wireshark capture of where the first publish to the client causes the client to stop making PINGREQs.
In this instance, the broker is 192.168.4.2 and the client is 192.168.4.10. In the Wireshark capture, the last PINGREQ is highlighted, packet 26. In packet 30, the broker closes the socket about 7.2 seconds after the last request which is almost 1.5x the keep alive timeout. The second Wireshark screenshot shows packet 28 with the PUBLISH packet and that it's a QoS of 0 or "Fire and Forget".
The default Quality of Service is set to 1 and when I publish to the client with a QoS of 1, I do not see the disconnect. I also set the changed MQTT_MESSAGES_QOS to 0 for the client, but I still saw the broker disconnect when publishing to the client with QoS of 0.
I noticed a similar problem with version 4 of the demo and v2.4 of ModusToolbox when I add a hardware timer. For some reason, the FreeRTOS software timer used generate the PINGREQ failed to fire and the MQTT broker would disconnect due to a timeout.
Thankfully, it seems that I can work around this issue by changing all of my publishes to a QoS of 1, but it would be nice to use a QoS based on the design and not a work around.
Any help would be appreciated,
Matt
Show LessHi,
My PSoC63 EVK used to be working and I am unsure what triggers it to stop working. The device is unable to boot up after flashing.
From the MTB 3.0 Console message, I can see that my image is being flashed to the device successfully. However, the device will fail with an error message stating that Vector Table of CM4 is not found.
I have updated my Kitprog firmware to the latest. Also, tried various flashing methods such as USB and miniprog. The device is unable to boot up.
In additional, I have tried to flashing the image using Cypress Programmer and PSoC Creator. The result is the same.
Any ideas?
Thanks.
Regards,
Gary
Show LessI have a pin I am using to read the voltage of my battery. It is divided by a couple of resistors. Let's name it BATT_VDIV. This signal also is run to my 3.3V voltage regulator enable pin.
The board works fine the first time it is powered on and when it is running. However, the issue is that once the Psoc connects that pin to the ADC it ends up sinking current when it is off. I have added a mux switch in there to prevent this, but if I turn the board off while the BATT_MUX switch is enabled, the vreg will never get a high enough voltage to power it back on.
Is there a way to guarantee this mux gets unhooked before the board is turned off. Maybe some brownout handler or something.
Show Less
Simple question. The middleware EmEEPROM can only use application flash or aux flash for storage.
Why can't the user areas of SFlash be used with EmEEPROM middleware?
Show LessWhat Firmware development tools are used for the IS1870 and IS1871?
modus example CTBM and UDB secure boot
Manager ,选型的时候发现, CTBM 、UDB、securereboot 这些功能,选型的时候我想更深入了解,
有更多资料吗 ?
moudus 没有相关例程 参考;其他的像 capsense crypto 等都有例程,我也理解,上述功能用的较少,有的客户比较较真,想了解更多
Help
Thanks
Show Less