Closed H1rono closed 1 month ago
ただ、どうやって観測するか(sprintf
を使うと書き込めなくなる)
このコードだとOpenOCDでのアップロードに失敗する STM32CubeProgrammerだとアップロードはできるが、UARTに何も出力されない
Info : clock speed 1000 kHz
Info : STLINK V2J45M31 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.263684
Info : [stm32f3x.cpu] Cortex-M4 r0p1 processor detected
Info : [stm32f3x.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f3x.cpu on 3333
Info : Listening on port 3333 for gdb connections
[stm32f3x.cpu] halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20003000
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
[stm32f3x.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
** Programming Started **
Info : device id = 0x10016438
Info : flash size = 64 KiB
Warn : Adding extra erase range, 0x08003604 .. 0x080037ff
Error: error writing to flash at address 0x08000000 at offset 0x00000000
embedded:startup.tcl:1516: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1581
at file "embedded:startup.tcl", line 1516
*** [upload] Error 1
.isr_vector
のサイズがなぜか0になっているのが原因(arm-none-eabi-objdump
で確認できる)
↑大嘘。.isr_vector
セクションはちゃんと中身がある
.pio/build/nucleo_f303k8/firmware.elf: file format elf32-littlearm
Contents of section .isr_vector:
8000000 00300020 7d270008 1d2b0008 1f2b0008 .0. }'...+...+..
8000010 212b0008 232b0008 252b0008 00000000 !+..#+..%+......
8000020 00000000 00000000 00000000 272b0008 ............'+..
8000030 292b0008 00000000 2b2b0008 2d2b0008 )+......++..-+..
8000040 cd270008 cd270008 cd270008 cd270008 .'...'...'...'..
8000050 cd270008 cd270008 cd270008 cd270008 .'...'...'...'..
8000060 cd270008 cd270008 cd270008 312b0008 .'...'...'..1+..
8000070 cd270008 cd270008 cd270008 cd270008 .'...'...'...'..
8000080 cd270008 cd270008 cd270008 cd270008 .'...'...'...'..
8000090 cd270008 cd270008 cd270008 cd270008 .'...'...'...'..
80000a0 cd270008 cd270008 cd270008 cd270008 .'...'...'...'..
80000b0 cd270008 cd270008 00000000 cd270008 .'...'.......'..
80000c0 cd270008 00000000 00000000 cd270008 .'...........'..
80000d0 00000000 cd270008 cd270008 cd270008 .....'...'...'..
80000e0 cd270008 cd270008 00000000 00000000 .'...'..........
80000f0 00000000 00000000 00000000 00000000 ................
8000100 00000000 00000000 00000000 00000000 ................
8000110 00000000 00000000 cd270008 cd270008 .........'...'..
8000120 00000000 00000000 00000000 00000000 ................
8000130 00000000 00000000 00000000 00000000 ................
8000140 cd270008 cd270008 00000000 00000000 .'...'..........
8000150 00000000 00000000 00000000 00000000 ................
8000160 00000000 00000000 00000000 00000000 ................
8000170 00000000 00000000 00000000 00000000 ................
8000180 00000000 cd270008 .....'..
一旦対処しない
とりあえずstdio.h
のAPIを使わないで進める、再発したら考える
2
DMAの設定で継続的に読んでくれる