Issue regarding updating firmware using second stage boot loader.

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

cross mob
haa_4305841
Level 2
Level 2

Hi,

I am using the Cypress Fx3 development kit(CYUSB3014) for my application.

Here, I'm facing a booting problem after updating firmware image file. As i am using second stage boot loader method to update the firmware and cypress EZ-USB SDK to build the code, after building the code if the disk image file size exceeds more that 168KB I'm facing this issue(As per cypress data sheet the maximum code size can be of 512KB). Second stage boot loader image file size is of 19KB.

So can you help me to find the root cause for this ASAP.

Thanks & Regards

Harsha

0 Likes
1 Solution

Hi Yashwant,

Thanks for the response, as of now i have reduced the I2C frequency into 200KHz and reduced the code size to 165KB.

And its working fine as of now, i would reopen this discussion if face the same issue later.

And thanks once again for your valuable inputs.

Thanks & Regards

Harsha

View solution in original post

0 Likes
6 Replies
YashwantK_46
Moderator
Moderator
Moderator
100 solutions authored 50 solutions authored 50 likes received

Hi Harsha,

You can go through the following path for .ld file which has all the code area, data area and buffer area according to which the firmware image is built by eclipse: C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\fw_build\fx3_fw\fx3.ld

Can you please share a snapshot of the error that you are facing?

Also, can you please elaborate the steps that you are doing when you face the error?


Can you confirm where you see the error, is it while building the code or is it while programming the device?

Regards,
Yashwant

0 Likes

Hello Yashwant,

Thank you for your quick response.

In my design I am using second stage boot loader to program application Firmware into the EEPROM

For my Second stage boot loader implementation, I referred Link : https://community.cypress.com/community/usb/usb-superspeed-peripherals/blog/2019/02/02/fx3-fail-safe...

Where my SSBL image size is 19KB, and I am programming this to the EEPROM address 0x0000

and by using SSBL I am programming my application FW to the EEPROM address 0x6000

And as per Cypress FX3's https://community.cypress.com/docs/DOC-10975

Step 1 : First stage bootloader will be loaded from BootROM

Step 2 : FSBL will load the SSBL from i2c EEPROM into SRAM and transfer execution to SSBL

Confirmed by toggling some GPIO's in SSBL, So the SSBL loaded into the SRAM and running successfully.

Step 3 : In SSBL I have modified to boot from I2C EEPROM from address 0x6000 (EEPROM address)

SSBL starts loading application FW from EEPROM into the SRAM, and transfer will given to application FW.

I am confirming that application FW loaded successfully or not by checking USB loopback device enumerated or not (Since application FW contains USB loopback device enumeration)

When the application FW size is less than 168KB, FW used to boot successfully always from the SSBL. After adding few more features to my application FW, FW size increased more than 168 KB, and booting of application FW fails randomly.

I tried modifying the cyfxtx.c of my actual FW and as well .ld file By increasing the code area size to 212KB by referring the link : https://community.cypress.com/docs/DOC-18707

Still I am facing the application FW loading issue.

Thanks & Regards

Harsha

0 Likes

Hello Harsha,

Can you please share the final firmware image size that you want to program?

Also, can you tell how you increased the code area to 212KB, i mean which area did you decrease inorder to increase the code area and what modifications in the firmware did you do?


Regards,

Yashwant

0 Likes

Hi Yashwant,

The final application firmware image file size is of 168KB & Second stage boot loader firmware image size is of 19KB.

To increase the code area i have referred these link  Modifying the Default Memory Map in FX3, CX3, FX3S, SD3, FX2G2, and SD2 - KBA229114 by deallocating the memory of SSBL which done in cyfxtx.c file.

By default

#define CY_U3P_SYS_MEM_TOP           (0x40078000)

After change

#define CY_U3P_SYS_MEM_TOP      (0x40080000)

Thanks & Regards

Harsha

0 Likes

Hi Harsha,

Can you please program the device and share UART debug logs of which API is failing?

Also, in the last response, you will have to allocate the space for SSBL even for the new LD file as you are using SSBL of 19KB size.

SSBL will be loaded first into the SRAM and then, the new firmware.

#define CY_U3P_SYS_MEM_TOP           (0x40078000)

You can use the default space or can reduce it upto 20KB, but if you do so, you should allocate the freed-up space to any other area like buffer area, or code area or else the space will not be utilized.

Please do the necessary so that we can understand why the device programming is failing.

Regards,
Yashwant

0 Likes

Hi Yashwant,

Thanks for the response, as of now i have reduced the I2C frequency into 200KHz and reduced the code size to 165KB.

And its working fine as of now, i would reopen this discussion if face the same issue later.

And thanks once again for your valuable inputs.

Thanks & Regards

Harsha

0 Likes