STM32F411CEU6 Blackpill. Upload firmware with offset

Hi!

  1. I made a bootloader for stm32 on Cube IDE.
  2. I made a firmware that blink an LED on Cube IDE.
  3. I uploaded the firmware using my bootloader. It works well.
  4. Now I want to make also firmware on Arduino Framework. Here is my code:
    main code:

main

ini:

my ld file:

linker

Bootloader runs code from address 0x08010000.

Build log:
Processing blackpill_f411ce (platform: ststm32; board: blackpill_f411ce; framework: arduino; upload_protocol: stlink; debug_tool: stlink; board_build.f_cpu: 72000000L; board_build.offset:
0x10000; board_upload.offset_address: 0x8010000; board_build.ldscript: “$PROJECT_DIR\linker.ld”; build_unflags: -DVECT_TAB_ADDR; build_flags: -Wl,–defsym=LD_MAX_DATA_SIZE=0x20000 -Wl,–defsym=LD_MAX_SIZE=0x50000 -Wl,–defsym=LD_FLASH_OFFSET=0x10000, -DVECT_TAB_ADDR=0x8010000)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CONFIGURATION: Redirecting...
PLATFORM: ST STM32 (14.2.0) > WeAct Studio BlackPill V2.0 (STM32F411CE)
HARDWARE: STM32F411CEU6 72MHz, 128KB RAM, 512KB Flash
DEBUG: Current (stlink) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES:

  • framework-arduinoststm32 @ 4.20000.210603 (2.0.0)
  • framework-cmsis @ 2.50700.210515 (5.7.0)
  • toolchain-gccarmnoneeabi @ 1.90201.191206 (9.2.1)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 10 compatible libraries
    Scanning dependencies…
    No dependencies
    Building in release mode
    MethodWrapper([“checkprogsize”], [“.pio\build\blackpill_f411ce\firmware.elf”])
    Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
    RAM: [ ] 0.7% (used 852 bytes from 131072 bytes)
    Flash: [ ] 2.2% (used 11444 bytes from 524288 bytes)
    .pio\build\blackpill_f411ce\firmware.elf :

section size addr

.isr_vector 408 134283264

.text 9880 134283672

.rodata 1424 134293552

.ARM.extab 0 134294976

.ARM 8 134294976

.preinit_array 0 134294984

.init_array 16 134294984

.fini_array 8 134295000

.data 140 536870912

.bss 712 536871052

._user_heap_stack 1540 536871764

.ARM.attributes 48 0

.comment 102 0

.debug_frame 1320 0

Total 15606

This code doesn’t work. I tried connecting in Debug mode. It seems that HAL_GetTick does not work. Tell me what could be the problem?

Looking good as this is 0x8010000. So the firmawre should build just fine.

And what is the code for that?

Hello. sorry for not answering for a long time. I found a solution to the problem. I changed the flags in my pio project:

1 Like