This moves the stack so that it is located in an area of SRAM
not modified by the system boot rom.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
According to the datasheet it is necessary to set the flash
accelerator value to 5 CPU clocks for 100-120MHz .
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Avoid wrapping the sector index, as that could potentially result in
erasing the booloader itself.
Also, move the stm32f4_sector_index() inline into erase_page().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
There was a Klipper bugfix for STM32F401 clock init.
There was a Klipper build bugfix when building with gcc hardfloat flags.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 4d969764 changed the "eof" command to return the number of
blocks instead of the number of pages written. Report the number of
pages written again.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't gather "blocks" into flash pages. Instead, write each "block"
to flash on each flash_write_block() request.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid read-modify-write operations on the FLASH->CR register. Write
out the desired valid explicitly.
Use writew() and writel() to write the flash bytes out to avoid gcc
reordering the memory write relative to the flash register writes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move application_check_valid() in bootentry.c to armcm_boot.c and make
the check specific to the ARM cortex-m. On these ARM machines it is
easier to validate the application stack address.
Also rename jump_to_application() to application_jump().
Also rename flash_read_block() to application_read_flash() and move to
armcm_boot.c .
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Allow the application start address to be configurable from "make
menuconfig".
Add a build check to verify the final binary can fit within the
configured size.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some boards require an initial gpio state in order to start USB. Port
the initial_pins capability from Klipper to provide that support.
This also synchronizes scripts/buildcommands.py with the latest code
from Klipper.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Create a board specific timer_setup() function and call it at the
start of sched_main().
Move udelay() from board code to sched.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Introduce the Klipper command_encode() and command_dispatch() style
functions. This makes it easier to import additional Klipper
low-level message handling code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>