Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
stan4233_475378
Moderator
Moderator
Moderator
100 sign-ins 50 replies posted 5 solutions authored

Hello,

I'm running MTB 3.2 GUI in Ubuntu 22.04.4 LTS and building the Security_App PSoC6 example for the Prototyping Kit (CY8CPROTO-062-4343W).

After creating the default Security_App example, I added the emeeprom (v2.20.0) component, so as to read/write settings to the PSoC6 32kB Auxilliary Flash.  I copied the code from Emeeprom's README.md

https://infineon.github.io/emeeprom/em_eeprom_api_reference_manual/html/index.html#section_em_eeprom...

And added a line CY_SECTION(".cy_em_eeprom") , so that emEepromStorage will be kept in the 32kB Auxilliary Flash.

However, the code failed to compile:

/opt/Tools/ModusToolbox/tools_3.2/cymcuelftool-1.0/bin/cymcuelftool --merge ../proj_cm0p/build/APP_CY8CPROTO-062-4343W/Debug/proj_cm0p.elf ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/proj_cm4.elf --output ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app.elf --hex ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app.hex; cp -f ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app.hex ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app_BOOT_raw.hex; rm -f ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app.hex; /opt/Tools/ModusToolbox/tools_3.2/gcc/bin/arm-none-eabi-objcopy --change-addresses=0 -O ihex ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app.elf ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app_BOOT_unsigned.hex; ../../mtb_shared/core-make/release-v3.3.1/make/scripts/python3.bash ../../mtb_shared/mcuboot/v1.8.1-cypress/scripts/imgtool.py sign --header-size 0x400 --pad-header --align 8 -v 1.0.0 -S 917504 -M 1792 --overwrite-only -R 0 -k ../proj_btldr_cm0p/keys/cypress-test-ec-p256.pem ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app_BOOT_unsigned.hex ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app.hex; cp -f ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app.hex ./build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app_BOOT.hex;
No ELF section .cychecksum found, creating one
Application checksum calculated and stored in ELF section .cychecksum
No ELF section .cymeta found, creating one
Checksum calculated and stored in ELF section .cymeta
Usage: imgtool.py sign [OPTIONS] INFILE OUTFILE
Try 'imgtool.py sign -h' for help.

Error: Image size (0x3fe0896) + trailer (0x20) exceeds requested size 0xe0000


make[1]: Leaving directory '/home/ub2204/work/psoc/tansiowk_mtw_3_1/Security_App_Emeeprom/proj_cm4'
cp: cannot stat './build/BOOT/APP_CY8CPROTO-062-4343W/Debug/primary_app.hex': No such file or directory
make[2]: *** [../../mtb_shared/core-make/release-v3.3.1/make/core/bwc.mk:161: _mtb_build__legacy_project_postbuild] Error 1
make[1]: *** [../../mtb_shared/core-make/release-v3.3.1/make/core/main.mk:385: secondstage_build] Error 2
make: *** [/opt/Tools/ModusToolbox/tools_3.2/make/application.mk:72: build] Error 2
"/opt/Tools/ModusToolbox/tools_3.2/modus-shell/bin/make CY_MAKE_IDE=eclipse CY_IDE_TOOLS_DIR=/opt/Tools/ModusToolbox/tools_3.2 CY_IDE_BT_TOOLS_DIR= -j6 all" terminated with exit code 2. Build might be incomplete.

I have attached the code, build error log and map file.

Thanks for any advice!

BR,

SK

0 Likes
1 Reply
stan4233_475378
Moderator
Moderator
Moderator
100 sign-ins 50 replies posted 5 solutions authored

I have tried using the CM4 app flash instead of the Auxiliary Flash.  That is, by commenting out the line CY_SECTION(".cy_em_eeprom") in main.c.  The code compiles OK but produce an error when executed the second time.

# First run was OK

=======================================================================
[INF] MCUboot Bootloader Started (CPU: CM0+) Apr 24 2024 11:43:53
[INF] Device lifecycle=0x01, dead0=0x00, dead1=0x00, secure0=0x00,
secure1=0x00

[INF] Active PC value: 0x00
[INF] Configuring protection units...
[INF] Protection units configured successfully!
[INF] Active PC value after protection unit configuration: 0x01

[INF] boot_swap_type_multi: Primary image: magic=bad, swap_type=0x1, copy_done=0x3, image_ok=0x2
[INF] boot_swap_type_multi: Secondary image: magic=bad, swap_type=0x1, copy_done=0x2, image_ok=0x2
[INF] Swap type: none
[INF] User Application validated successfully

[INF] --- rsp Addr 0x0802FFCC

[INF] --- HDR Addr 0x0802FFCC
[INF] --- br_flash_div_id 0x0000007F
[INF] --- br_image_off 0x00020000
[INF] --- ih_load_addr 0x00000000
[INF] --- ih_img_size 0x00030445
[INF] --- ih_hdr_size 0x00000400
[INF] --- ih_protect_tlv_size 0x00000000

[INF] CM0 app stack: 0x08030000
[INF] CM0 app PC: 0x100206D3
[INF] Starting User Application on CM0+. Please wait...
Life Cycle Stage : NORMAL
ReadUniqueID : Device unique ID is: 0x049615ee 0x01bf2007 0x0076091b
Cy_Em_EEPROM_Write ok
Cy_Em_EEPROM_Read ok

=========================================================
[DFU task] Image Type: BOOT, Version: 1.0.0, CPU: CM4,
Apr 24 2024, 14:15:36

=========================================================
Unique Device ID received: 0xAA55AA55
Starting DFU operation

 

# Second run produced an error because mcuboot discovered that CM4 flash area has been modified

=======================================================================
[INF] MCUboot Bootloader Started (CPU: CM0+) Apr 24 2024 11:43:53
[INF] Device lifecycle=0x01, dead0=0x00, dead1=0x00, secure0=0x00,
secure1=0x00

[INF] Active PC value: 0x00
[INF] Configuring protection units...
[INF] Protection units configured successfully!
[INF] Active PC value after protection unit configuration: 0x01

[INF] boot_swap_type_multi: Primary image: magic=bad, swap_type=0x1, copy_done=0x3, image_ok=0x2
[INF] boot_swap_type_multi: Secondary image: magic=bad, swap_type=0x1, copy_done=0x2, image_ok=0x2
[INF] Swap type: none
[ERR] Image in the primary slot is not valid!
[INF] MCUboot Bootloader found no bootable image.
[INF] --- rsp Addr 0x0802FFCC
[INF] --- HDR Addr 0x00000001

 

0 Likes