-
Notifications
You must be signed in to change notification settings - Fork 143
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a FLASH resident bootloader #625
Comments
I'm not sure you want to have one big hex/binary file, since the bootloader is probably not 128kB large, so if you want to have one continuous binary, there'll be a lot of zeros in there until the application starts. You could however call OpenOCD manually and program both ELFs in one go:
I'm not sure about debugging both apps at the same time, it would be really neat if you made that work though. |
Just FYI: there's an option for flash offsets so you don't have to create your own application linkerfile. |
The CMake scripts is not relying on start-group and end-group linker flags, so creating static libraries containing modm itself is dangerous. Unreferenced objects might disappear since "used" attribute is not specified in the source and linker tables is also a problem. (eg. hardware init and assert) |
Thanks for all your advice guys..
|
I'm closing this as this solution is not something we can integrate into modm. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hello folks,
I'm trying to implement a FLASH resident bootloader. What are people's thoughts on the best way?
Obviously not my way.. but for completeness, I'll describe my nugatory efforts so far...
I've generated 2 separate modm builds - first call 'bootloader', second called 'app'.
bootloader resides in the first 128K and the 'app' linker file shifts everything up by the same amount.
Both projects work as expected - the bootloader jumps to the application codes reset handler... But, in order to do this, I have to download it separately - bootloader first then application code. Ideally, I want to pull the precompiled bootloader (as a static library?) into the application - and maybe even get it working on the debugger. Need to be combined in the hex file.
To this end I've prepared the app linker file:
I've pulled across uncommitted updates to CMake from @Jasa - which is quite neat #568
Then added the following to the bootloader MakeFileLists:
This generates a bootloader_lib.a
My aim is to pull this into the application. I have added the following to the application MakeFileLists:
(there are better ways - find_library() etc, but I just want to see it working before the tidy up)
From the *.map file below, obviously, it's not worked.. I've come from IAR hence my appaling use of CMake!
Are there any hints on this to be shared?
Should I make a 3rd CMakeLists and include the other two?
Or - Can anyone share the relevant CMake/linker cut & pastes for a simple FLASH resident bootloader?
Happy to share the working files here once (if!) I manage to crack this.
I am thinking of using srec 'cat' to combine the bin (or elf) files into one - but it just seems hacky to me..? Style-guide: Should I, shouldn't I? Whats the 'modm' way?!
For what it's worth I've included the projects files - (working using VisualGDB and not included *.sln dir)
project_2.zip
The text was updated successfully, but these errors were encountered: