cancel
Showing results for 
Search instead for 
Did you mean: 

Where is the YMODEM code located for SBSFU?

FWguy
Associate II

What .c file has the code for the YMODEM portion of the SBSFU pictured below ?0693W00000GW7cAQAT.pngI have found the string "File> Transfer> YMODEM> Send" a few times, but when I changed the string to test if I found the correct area, nothing changes in the picture above.

Another tip as to why I don't think I've found the correct code location, is when I have changed the string "File> Transfer> YMODEM> Send" to say "File> Transfer> YMODEM> Send TEST" If I open the SBSFU.elf file the string is unchanged as shown below.

0693W00000GW7dXQAT.png 

9 REPLIES 9
Bubbles
ST Employee

Hi @FWguy​ ,

I believe you are looking for file sfu_com_loader.c 

BR,

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello @JHOUD​ 

I was looking into that file too as it has a lot of the YMODEM functions, however it doesn't have the "File> Transfer> YMODEM> Send" string within that file. Maybe you see something I don't?

I'm still looking into this, but I'm now thinking it has to be changed earlier in the SBSFU pipeline. As in, maybe its code is compiled into the secure engine so I'm trying to change it to late in the process after it's been secured?

When I open the SBSFU.bin in a Hex editor and swap out the characters "File> Transfer> YMODEM> Send" to "File> Transfer> YDAVEM> Send" Then this is what gets shown after I download the file to the board and run Tera Term. So I guess another way of putting it is, I'm looking for the code that feeds into the SBSFU.bin file, what code is that and what is the YMODEM part of that code?

Arno1
Senior

You are looking for sfu_loader.c, line around 120.

Are you sure you are looking in the right project directory?

Hi, that could be it. You sometimes need to rebuild all three projects to be sure that a change you done is propagated into the binary.

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

When you say "rebuild all three projects," I'm building SECoreBin, Loader, SBSFU, and then my application. Are those the same projects you're referring too?

I just took a look at sfu_loader.c around 120, and this is what I see...

I added lines 125 and 141 and added the "b" to the end of line 140. I've never seen those lines show up once I put the SBSFU.bin on the board.

0693W00000GWVGmQAP.png

In Eclipse, if you open the project settings for SBSFU and UserApp and go to 'Project References', you can set the project dependencies.

You would need the following:

UserApp: Select SECoreBin and SBSFU

SBSFU: Select only SECoreBin

Now, if you make a change in SBSFU, UserApp will also be built. Make a change in SECoreBin and both SBSFU and UserApp will also be built. You will still need the occasional clean build if it doesn't pick up the latest changes.

OK, lines numbers are a bit different but I wasn't looking at a clean SBSFU project.

Can you tell us which project (for which MCU/demo board) you are using and which version of x-cube-sbsfu.

You would have to use the debugger and step through the code to see where and how it reaches the line you are looking for.

FWguy
Associate II

I've found I can change the "File> Transfer> YMODEM> Send" string in Loader_bin.o and it will show in SBSFU.elf, but now looking to see where Loader_bin.o gets compiled from. I can delete Loader_bin.o completely and it will be back once I complete compiling everything. I would think that some how the code I change in Loader.c would get compiled into Loader_Bin.o and then SBSFU.elf, but so far I haven't been able to find that link.