Mleaf / stm32flash

Automatically exported from code.google.com/p/stm32flash
0 stars 0 forks source link

Programming problem with 0.4 over UART #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am using version 0.3 without issue, I just tried 0.4 but I am getting an 
error.

I've attached a file that fails, although I don't think it's related to the 
file at all. I also notice that stm32flash writes the whole memory even if the 
HEX file is sparse.

The command is:

./stm32flash -b 115200 -i 26,32,-25,25:-26,-32,-25,25 -w copro.hex /dev/ttyAMA0

Here is the console output:

stm32flash 0.4

http://stm32flash.googlecode.com/

Using Parser : Intel HEX
Interface serial_posix: 115200 8E1
Version      : 0x30
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0416 (L1xxx6(8/B))
- RAM        : 16KiB  (2048b reserved by bootloader)
- Flash      : 128KiB (sector size: 16x256)
- Option RAM : 16b
- System RAM : 4KiB
Write to memory
Erasing memory
Wrote address 0x08009300 (99.58%) Error: WRITE address and length must be 4 
byte aligned
Failed to write memory at address 0x08009300

Original issue reported on code.google.com by quacks...@gmail.com on 30 Oct 2014 at 11:42

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks for the report, and especially for providing a test case. Does it fail 
also if you convert the hex file to a binary?

Original comment by lists.to...@gmail.com on 24 Feb 2015 at 8:58

GoogleCodeExporter commented 9 years ago
In stm32.c you can simply change

    /* must be 32bit aligned */
-   if (address & 0x3 || len & 0x3) {
to
    /* must be 32bit aligned */
+   if (address & 0x3) {

because after that you anyway pad data to needed size

Original comment by smal.r...@gmail.com on 20 May 2015 at 6:45