-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[breaking] Error: Data length doesn't have a 32 bit alignment: +2 byte. #390
Comments
what device are you using? |
stm32l100 discovery, |
@mcoquelin-stm32 you refactored all code in PR #384, can you test this as described below with latest master. As I have no hardware laying around to verify/debug this and currently have no in-depth knowledge of the internal workings. |
Commit e43a737 removes one instruction in stm32l and stm32l0 loaders, which results in 32 bits alignment breakage so that loarder load fails: ~/stlink/st-flash write main.bin 0x8000000 2016-04-06T00:13:28 INFO /home/jg/stlink/src/stlink-common.c: Loading device parameters.... 2016-04-06T00:13:28 INFO /home/jg/stlink/src/stlink-common.c: Device connected is: L1 Medium-Plus-density device, id 0x10086427 2016-04-06T00:13:28 INFO /home/jg/stlink/src/stlink-common.c: SRAM size: 0x8000 bytes (32 KiB), Flash: 0x40000 bytes (256 KiB) in pages of 256 bytes 2016-04-06T00:13:28 INFO /home/jg/stlink/src/stlink-common.c: Attempting to write 16816 (0x41b0) bytes to stm32 address: 134217728 (0x8000000) Flash page at addr: 0x08004100 erased 2016-04-06T00:13:29 INFO /home/jg/stlink/src/stlink-common.c: Finished erasing 66 pages of 256 (0x100) bytes 2016-04-06T00:13:29 INFO /home/jg/stlink/src/stlink-common.c: Starting Half page flash write for STM32L core id Error: Data length doesn't have a 32 bit alignment: +2 byte. Aborted This patch adds some padding at the end of these loaders to fix the alignment. Reported-by: https://github.com/Jegeva Fixes: stlink-org#390 Signed-off-by: Maxime Coquelin <[email protected]>
Hi, I removed an instruction in the stm32l and stm32l0 loaders, so it is no more aligned on 32 bits. Could you test the following patch, and let me know if it solved your issue? Thanks in advance, |
@tomdeboer and @Jegeva could you verify on your hardware with this patch it fixes the issue? |
I tried the patched version on L073RZ device, without success, Still there seems to be some issue (probably #334) with flashing using st-flash utility. |
Commit e43a737 removes one instruction in stm32l and stm32l0 loaders, which results in 32 bits alignment breakage so that loarder load fails: ~/stlink/st-flash write main.bin 0x8000000 2016-04-06T00:13:28 INFO /home/jg/stlink/src/stlink-common.c: Loading device parameters.... 2016-04-06T00:13:28 INFO /home/jg/stlink/src/stlink-common.c: Device connected is: L1 Medium-Plus-density device, id 0x10086427 2016-04-06T00:13:28 INFO /home/jg/stlink/src/stlink-common.c: SRAM size: 0x8000 bytes (32 KiB), Flash: 0x40000 bytes (256 KiB) in pages of 256 bytes 2016-04-06T00:13:28 INFO /home/jg/stlink/src/stlink-common.c: Attempting to write 16816 (0x41b0) bytes to stm32 address: 134217728 (0x8000000) Flash page at addr: 0x08004100 erased 2016-04-06T00:13:29 INFO /home/jg/stlink/src/stlink-common.c: Finished erasing 66 pages of 256 (0x100) bytes 2016-04-06T00:13:29 INFO /home/jg/stlink/src/stlink-common.c: Starting Half page flash write for STM32L core id Error: Data length doesn't have a 32 bit alignment: +2 byte. Aborted This patch adds some padding at the end of these loaders to fix the alignment. Reported-by: https://github.com/Jegeva Fixes: stlink-org#390 Signed-off-by: Maxime Coquelin <[email protected]>
Hi @gluedig, I pushed a v2 fixing the missing comma, but again, I cannot test it for now. The reason I modified the loaders was to use a common ABI with all version so that the code can be simplified. Thanks, |
Hi @mcoquelin-stm32 |
i tried on L053, it works ok |
@gluedig I read your message after creating the previous fix. I overlooked the instruction you mentioned, but after trying it and verifying it works, I think it's should be preferred over my previous fix, which was basically a rollback to the last-working commit. Also, looking at the stm32lx.S loader from OpenOCD, I believe the loaders for the STM32L1 and the STML0 are actually the same. Would you be able to make the L0 device also use the |
@tomdeboer to understand correctly: i have all mentioned above on branch |
Hi guys, can we call this issue done with the merge? |
works for me |
Yeah I think we can close it |
Thanks all for your time, effort and fixing! |
in the lasted version of stlink with
stm32l100 discovery
:Error: Data length doesn't have a 32 bit alignment: +2 byte.
older version is working fine (same board, same main.bin) :
OLDVERSION (99ed475):
NEW VERSION:
The text was updated successfully, but these errors were encountered: