rogy-AquaLab / 2024_umiusi_nucleo_cube

umiusiの足 with STM32Cube
MIT License
0 stars 0 forks source link

ADC #7

Closed H1rono closed 1 month ago

H1rono commented 1 month ago

2

DMAの設定で継続的に読んでくれる

H1rono commented 1 month ago

ただ、どうやって観測するか(sprintfを使うと書き込めなくなる)

H1rono commented 1 month ago

このコードだとOpenOCDでのアップロードに失敗する STM32CubeProgrammerだとアップロードはできるが、UARTに何も出力されない

H1rono commented 1 month ago

image

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
H1rono commented 1 month ago

メモ https://github.com/openocd-org/openocd/blob/d09ff476446a5403e556476b41a5a3c9bdf0a706/src/flash/nor/core.c#L93

H1rono commented 1 month ago

.isr_vectorのサイズがなぜか0になっているのが原因(arm-none-eabi-objdumpで確認できる)

H1rono commented 1 month ago

↑大嘘。.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                    .....'..        
H1rono commented 1 month ago

一旦対処しない とりあえずstdio.hのAPIを使わないで進める、再発したら考える