[CYW43907] How to download directly to RAM ?

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

cross mob
JoLE_3168931
Level 3
Level 3
First like received Welcome!

Hello,

in order to speed up the downloading process time on the CYW943907AEVAL1F board, is there any way to download code and data directly to the RAM ?

Thank you.

1 Solution

Well, actually, it is pretty straightforward.

You just need to load the application ELF file in RAM with OpenOCD (+some initializations coming from the sflash_write TCL script).

After all, it's what the tiny bootloader does.

You still may need to download DCT first (we manage to stub the access to avoid this soon).

Now, the application is loaded and reset in less than 3 seconds (even less if you keep the OpenOCD session open), instead of 25 seconds when using flash.

I could post the script here if someone is interested, but I would prefer that it comes from the Cypress team to avoid mistakes.

View solution in original post

0 Likes
7 Replies
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Sorry there is no way of downloading directly to RAM in CYW43907

0 Likes

Do you mean that it's not feasible, because of hardware restrictions or some sort of ROM bootloader issues, or that we have to write dedicated linker and OpenOCD scripts ?

0 Likes

Well, actually, it is pretty straightforward.

You just need to load the application ELF file in RAM with OpenOCD (+some initializations coming from the sflash_write TCL script).

After all, it's what the tiny bootloader does.

You still may need to download DCT first (we manage to stub the access to avoid this soon).

Now, the application is loaded and reset in less than 3 seconds (even less if you keep the OpenOCD session open), instead of 25 seconds when using flash.

I could post the script here if someone is interested, but I would prefer that it comes from the Cypress team to avoid mistakes.

0 Likes

Hello,

Thank you so much for the pointers.

I am exploring the sflash_init function in sflash_write.tcl script which downloads the sflash_write into RAM and executes it.

>>openocd-all-brcm-libftdi.exe -s ../scripts -f ../CYW9WCD1EVAL1.cfg -f ../BCM4390x.cfg -f C:\Users\riya\Documents\WICED-Studio-6.4\43xxx_Wi-Fi\apps\waf\sflash_write\sflash_write.tcl -c "sflash_init CYW943907AEVAL1F-P103-SoC.43909 43909"

Please let me know if you were able to test running an application directly on RAM. I am facing error in determining the entry_address for the provided binary.

0 Likes

I don't understand, you don't work for Cypress ?

0 Likes

Hello,

The sflash_init can be used for downloading into RAM. The load_image command takes two arguments : image to be downloaded and the RAM address. load_image internally calls the OPENOCD loadimage command to download the file at the given address and than the PC value can be set to the starting address.

Are you trying to run the APP0 application from directly from RAM? or trying to reset the device faster by downloading and running the waf.bootloader onto RAM.

As per the boot process, the ROM bootloader checks a valid image at 0x1400 0000. The valid image will have a trx header as mentioned in the file  /43xxx_Wi-Fi/WICED/platform/MCU/BCM4390x/make_trx.pl

lock attach
Attachments are accessible only for community members.

See attached the (quick'n dirty) scripts that I use (windows only).

As it stops the CPU and jumps to the entry point, it bypass the bootloader.

As I said, I just copied the commands from the sflash_write tool.

Usage:

load_elf.bat <path_to_your_elf>

ex:

load_elf.bat build\test.powersave-CYW943907AEVAL1F\binary\test.powersave-CYW943907AEVAL1F.stripped.elf