Skip to content
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

flash_add_block: unaligned block #196

Closed
sinosoidal opened this issue Dec 11, 2013 · 2 comments
Closed

flash_add_block: unaligned block #196

sinosoidal opened this issue Dec 11, 2013 · 2 comments

Comments

@sinosoidal
Copy link

Hi,

We been using your stlink project in order to program STM32F4XX chips.

Recently we have upgraded the chip on our system to STM32F427VG and one curious thing started to happen. I don't now if this is a bug or something i'm doing wrong.

We are using st-util tool to be able to program the chip thru gdb. Since we changed chip, doing a load on gdb, I get the following error:

flash_add_block: unaligned block

I tried to reverse engineer the source code in order to understand why, and it doesn't make sense. This error happens when:

addr % FLASH_PAGE != 0 || length % FLASH_PAGE != 0

Addr in this case is 0x8020000 and flash page is 128k
length is about 80k which is less than 128k, so this devision doesn't give a zero remaining and it fails.

In order to continue using this tool I had removed the second condition and everything works as expect.

What I can't understand is why, because with the last chip it worked (STM32F405) and the memory layout was exactly the same.

Since I'm not sure if this is a bug or an unpredicted case, I have decided to report my experience.

Thanks for this awesome project.

@iabdalkader
Copy link
Contributor

I'm having the same issue, I don't think it has anything to do with the MCU ( it's an STM32F429 anyway), I think it assumes that length is a multiple of the current sector size (PAGE_SIZE), for some reason, so if your ld script starts on some sector which is not, it fails.

@Nightwalker-87
Copy link
Member

Fixed in #251.

@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants