Comments (3)
Hi @vicgwee, perhaps I should have documented the highboot bootloader a little better.
When it writes the application into flash, it modifies the contents of the vector table in the first flash sector so that the reset address points to the bootloader instead of the application. This ensures that the bootloader is the first program to run. When the bootloader decides to boot the application, it then jumps to the application's reset address which is stored in an unused slot in the vector table.
The bootloader attempts to appear totally transparent compared to if there were no bootloader installed, so if you perform a firmware upload, you would expect to get back the same firmware that you put in, which means it does not include the modified vector table or the bootloader itself, so if you flash that image with st-flash, it's not any different than if you were to just flash the original image with st-flash.
Could you elaborate a bit on what you're trying to accomplish? Did you want to create single flashable image that includes the bootloader and the application together? If so, you could potentially do this with a bit of careful linker script construction or by using st-flash to read out the complete flash contents directly rather than using the dfu upload capability to read back the firmware.
from dapboot.
Hi @devanlai, thanks for the quick response! I see, the bootloader's 'totally transparent' feature has worked very well :) I was quite surprised when the vector tables were the same!
Yes, I would like my build tool to create a single flashable image so that whenever I use my ST-Link, I don't have to re-flash the bootloader and then download my program using the bootloader. Would you recommend using the highboot or the standard bootloader for that?
EDIT: I took a look at some of the history of highboot and saw it was mentioned in #23 that
The high-memory bootloader has a brief window of danger when rewriting the mixed application/bootloader vector table where it can brick itself if it is reset or power is lost in the middle of the middle of erasing / writing the vector table.
Since that is the case, I would prefer to use the standard bootloader instead!
from dapboot.
There are a few different ways to generate a combined image.
If you're generating a bin file, it's an exercise in taking the bootloader bin file and padding it until the size equals to the application offset (which is 8KiB for the standard dapboot image). If you don't mind padding with zeroes (which means the padding will be written into the flash instead of just erasing flash to 0xFF), there are some shell-script friendly ways to do so with dd
, e.g: How to pad a file to a desired size.
For padding with 0xFF, it's not as straightforward to use common shell tools so I just use a small Python script.
If you're generating a hex file, there are utilities that can handle merging hex files together, e.g: Merging 2 hex files.
from dapboot.
Related Issues (20)
- Windows 7 weird performance. Hangs after download is finished HOT 5
- CubeMX minimal example not working correctly HOT 2
- Add delay before reading the button
- Add attribute to avoid a warning by GCC
- Add #ifndef in generic.h, so we can override without local.mk HOT 2
- STLINK_HIGH doesn't fit into flash HOT 12
- Unable to use hex file with WebUSB HOT 4
- GD32F30x support HOT 2
- Missing usb_bos_descriptor typedef and defines HOT 8
- jump_to_application doesn't clean up after dapboot HOT 2
- Overriding target_get_force_bootloader HOT 4
- When the bin file download is being done, how I return the device from DFU to UART? HOT 2
- Can someone explain little more about how to build the DFU binary?
- Thanks! HOT 2
- Flashing dapboot-v1.20 using openocd
- SET ADDRESS Error on upload my firmware HOT 2
- Where is winusb descriptor string defined? HOT 2
- PR of `usbd_register_extra_string` commit from devanlai/libopencm3? HOT 2
- [Feature Support]Add support for STM32F303 MCU HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dapboot.