STM32 bin file at address 0x4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 03:39 AM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 10:16 AM - edited ‎2024-01-31 10:17 AM
This seems unnecessarily complex and laboured.
Typically you build an app for a specific address, via the linker. The Vector Table is part of the image. The SystemInit() code can set the address of SCB->VTOR based on the symbol the linker assigns the table in a given build. The application should and can be agnostic to the location it's built to live.
You put the Loader at 0x08000000, App1 at 0x08008000, App2 at 0x08020000, or however they need to space related to the size of the respective images and the space available in the FLASH. These BASE addresses are the only thing the Loader really needs to know.
The Vector Table contains the entry point (Reset_Handler) and you hand off control there.
It's also not hard to embedded length of image data in there too if need be.
Most of the CM3 from ST will want the vector table to live at a 512-byte boundary, but this depends on the size and total number of vectors, rounded to the next power of 2
The LINKER is DESIGNED to compute and solve placement problems, and fixate addresses, it can use and generate symbols, let it do the hard work by doing it's job.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 03:40 AM
What about it?
:thinking_face:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 03:44 AM
Sorry. Here the question :
I made a testing soft who start at 0x2B200
I notice than bin file has the (org address+1) at 0x04
That's OK and I used it for controlling file.
But when the file increase in size I noticed value at 0x4 was now 0x35B29 !
What can I do for this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 05:48 AM
"Small" one
Bigger one, at the same adress
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 05:50 AM
And big soft has about 50ko lenght (at always start at 0x2B200)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 06:15 AM
> What can I do for this ?
Why do you want to do something about it? What problem is it presenting?
That is the location of Reset_Handler within the binary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 06:34 AM
With the value of bin file at 0x4 , how do you calculate address to jum to ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 06:37 AM
Sorry for my keyboard.
I try again.
If my soft has a low size, I can calculate jump address will be (value at 0x4)-1
But if the soft is bigger, how do you calculate jump adress using 0x4 value ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 06:59 AM
I don't understand why the value matters. The calculation is the same. (value at 0x04 - 1).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-31 07:09 AM
0x35B29-1=0x35B28, not 0x2B200