cx3 bootloader issue

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

cross mob
chte_4406741
Level 1
Level 1

Hi technical support team,

I'm developing cx3 firmware in-application upgrade function.But now blocked by one issue. Please help me to figure it out.

Please find my operation steps as below:

  step 1 runs good.

Set Pmode Pin to run ROMboot. It runs usbboot and ControlCenter recognized it as bootloader. And I update the 2-stage bootloader to SPI FLASH directly.

  step 2: still fine.

Set Pmode Pin to user mode and select SPI boot options. And the 2-stage bootloader(original from V1.3.4 SDK) runs successfully, cause it has been recognized as USBStreamer Example by the ControlCenter. It seems good till now.

   step 3: seems FAIL.

Use Control Center to download my application image to SPI flash. But after i chose my app.img, the ControlCenter shows SPI flash erase fail and upgrade blocked.

Isn't it a little strange here? From my point of view, no matter bootROM or 2-stage bootloader is used, the ControlCenter will download the bootProgrammer image to CX3's RAM through the usbboot channel. And the downloaded bootProgrammer in RAM will executes the SPI FLASH erase/write/read operations. But now, the same image achieves the different results.

Question 1: How would this happen? Is there any checksum not match when using different bootloader? How to resolve this problem?

Question 2: I found bootProgrammer .img located at the same routine with ControlCenter.exe. Is this image same with the sample FlashProg project in v1.3.4 SDK?  

BTW, I have read the FailSafe bootloader doc, and the image merge tool seems good. But what if I change the APPs' location in FLASH, does it still suitable? I haven't found the source code published. So, I have to use the 2-stage bootloader companion with ControlCenter.exe to upgrade my first APP, and then the APP upgrade the following APP...

0 Likes
1 Solution

Hi Rashi,

Thanks very much for your help.

I found some guy have the same question with mine. And the problem had been resolved. Bootloader loads image to RAM but does not execute it.

View solution in original post

0 Likes
7 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please refer to this thread for the understanding FX3 Boot / Firmware Update Best Practices

- Please confirm that firmware image base addresses are appropriate.

- You can also try with FX3 Fail Safe Firmware Update

- The merger app is for combining Second Stage bootloader image and two copies of firmware image.So if you are using this utility you don't have option to select address for the firmware

Are you using the default firmware Fx3BootAppGcc?

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi RashiV_61,

Thanks for the reply. Yes, I do have read the FX3 Boot / Firmware Update Best Practices. The solution is great and I deside to use it too.

But like the description of FX3 Fail Safe Firmware Update, there are some limitations in Merge APP, and it's not suitable for mass production. So, I need to develop some other replace solutions. And I guess there is one.

Just as I mentioned before, ROMboot load the 2-stage boot, and the 2-stage boot would upgrade the APP_1  by cooperating with ControlCenter.exe. Then, the APP_1 would cooperate with the specified Host PC APP from ourselves. So, we would not be limited by the merge APP.

And now I'm testing this solution. When I download the default Fx3BootAppGcc image to SPI flash address 0x00000000. I suppose the original ControlCenter.exe will replace the Fx3BootAppGcc image located at 0x00000000 to my testAPP_1 image( cause the bootprogrammer.img has not been modified). But, it fails when erasing the Flash and the upgrade process stopped. It must be some problem here. This is just a simple test, the APP_1 location is wrong here and it will be modify to right place when production.

From my understanding, the ControlCenter.exe will update the bootloader to bootprogrammer when updating the firmware. So, there's a little weird that the same bootprogrammer run two times, first time is successful and the second time fails.

     >1st time, when I use romboot to download 2-stage bootloader to flash 0x00000000.

     >2nd time, when I use 2-stage bootloader to download APP_1 to flash 0x00000000.

Maybe you can have a test with the same process. I think it's easy to reproduce.

0 Likes

Hello,

If you have enabled SPI boot in the Fx3BootAppGcc firmware, you need to give the address of the Application firmware which you need to load. This firmware should also be in the SPI flash.

As per your previous post, you said you APP_1 is 0x00000000 at this address which doesn't seem possible.

The second stage boot loader will load the firmware from the flash address you mention in the firmware and not from the Control Center.

Your flash should contain both the images one for the Second bootloader and one for the application firmware.

Please confirm that you are doing it.

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi,

Yes, normally, as the FailSafe Firmware mentioned, I should download the application together with the Fx3BootAppGcc. Thus the Fx3BootAppGcc can load application firmware to RAM. And this process need the CombineAPP and it cannot satisfy my changing address request.

I recognize that maybe Controlcenter can help me to download the application to flash by cooperating with Fx3BootAppGcc. Thus, the Fx3BootAppGcc can boot the APP as normal. But it seems the bootProgrammer failed to download APP to flash.


The second stage boot loader will load the firmware from the flash address you mention in the firmware and not from the Control Center.

>>>The romboot can load bootProgrammer from Controlcenter, so I suppose the Fx3BootAppGcc can load bootProgrammer from Controlcenter at the same. And it succeed indeed. The bootProgrammer has been recognized by ControlCenter as I mentioned before.

As per your previous post, you said you APP_1 is 0x00000000 at this address which doesn't seem possible.

>>>You're right. It's not possible to run the normal purpose.

But if the ControlCenter download the APP_1(located at 0x00000000) flash successfully. After reset. the romboot should load the APP_1

to RAM and run the APP_1 directly while the  Fx3BootAppGcc has been erased. This also can help me the judge the solution. Am I right?

So, the question is why ControlCenter and Fx3BootAppGcc cannot download firmware to flash? It fails when bootProgrammer trying to erase the flash. 

0 Likes

Hi RashiV_61

There's a mistake in the description that the bootProgrammer is not initialized successfully. So, it seems the 2-stage boot cannot boot the BootProgrammer through ControlCenter. How can I fix this? Since the romboot can make it, I suppose the 2-stage boot can do it too.

Hope getting your response soon. Thanks very much.

0 Likes

Hello,

The default Fx3BootAppGcc loads the program from the Starting address of the SPI  Flash. If you will be changing the application firmware storage address, you have to change the address in Fx3BootAppGcc code.

Fx3BootAppGcc doesn't not provide handle to download the application firmware from the control center. The application firmware should be stored in the Flash before you boot the second stage boot loader.

Fx3BootAppGcc doesn't call any other firmware for writing to Flash unlike the ROM boot loader.

Please follow these steps (just for checking purpose)

- Program bulksrcsink example to the SPI Flash.(PMODE line for SPI boot with USB Fallback)

- Reset the device and Set PMODE lines for USB boot and program the RAM with Fx3BootAppGcc (second stage boot loader).

- You will see Cypress FX3 USB Streamer Example Device Enumeration the Control Center. This indicated that the bootl oader has successfully loaded the bulksrcsink example to the RAM.

- As per you application, you need both the Second stage boot loader and application firmware in the Flash, you have program the Flash with both of them prior using default second stage boot loader or else you need to customize the second stage boot loader according to your application.

Please let me know the results after the test.

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi,

Thanks very much for your help.

I found some guy have the same question with mine. And the problem had been resolved. Bootloader loads image to RAM but does not execute it.

0 Likes