I’m on Windows, what are you on? Also, I’m running some tests using my makefile project vs pio.
I’m putting together the documentation. It will take me a bit to get it all sorted out. As best as I can tell, cliff notes version:
- If I uncomment a .h file in stm8_conf.h, I will get the DWARF error. It also puts these first in the compile and link order.
- If I add the same files to source and include manually, and comment them out in stm8_conf.h, I do NOT get the DWARF error. It also puts main.c/rel first in the compile and link order.
I’m running tests using my makefile project where I compile all the files manually. I played with the order of the files, and I can find no difference in this. I never get the DWARF errors. I did realize that Eclipse was using arm-non-eabi-gdb. This likely caused my errors I had before. I tested my *.elf files using stm8-gdb.
To test similar to me, add the files into the source folders instead of letting them get loaded via stm8s_conf.h. Let me know if you see the same results I do. That is the only real change. I also have manually added stm8s_it.c to source, and stm8s_it.c to include. I have tested this to success and fail with stm8s_tim1.c/h, and stm8s_clk.c/h. If loaded via conf, fail. If added manually to source list, pass.
- Last 2 tries with stm8s_clk.c/h. First from conf include, second manual include:
C:\Users\branderson\OneDrive - Trek Bicycle Corporation\Documents\PlatformIO\Projects\TestDemo.pio\build\stm8s003f3>C:\Users\branderson.platformio\packages\tool-stm8binutils\bin\stm8-gdb.exe firmware.elf
GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “–host=x86_64-w64-mingw32 --target=stm8-none-elf32”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type “help”.
Type “apropos word” to search for commands related to “word”…
Reading symbols from firmware.elf…Dwarf Error: Could not find abbrev number 110 in CU at offset 0x0 [in module C:\Users\branderson\OneDrive - Trek Bicycle Corporation\Documents\PlatformIO\Projects\TestDemo.pio\build\stm8s003f3\firmware.elf]
(no debugging symbols found)…done.
(gdb) qC:\Users\branderson\OneDrive - Trek Bicycle Corporation\Documents\PlatformIO\Projects\TestDemo.pio\build\stm8s003f3>C:\Users\branderson.platformio\packages\tool-stm8binutils\bin\stm8-gdb.exe firmware.elf
GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “–host=x86_64-w64-mingw32 --target=stm8-none-elf32”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type “help”.
Type “apropos word” to search for commands related to “word”…
Reading symbols from firmware.elf…done.
(gdb) q
- list of files compiled for last successful test.
Building in debug mode
sdcc -o .pio\build\stm8s003f3\src\main.rel -c -mstm8 --debug --out-fmt-elf --opt-code-size -DF_CPU=16000000L -DPLATFORMIO=50101 -DSTM8S_003 -DSTM8S003 -DUSE_STDPERIPH_DRIVER -DUSE_STDINT -D__PLATFORMIO_BUILD_DEBUG__ -Iinclude -Isrc -IC:\Users\branderson.platformio\packages\framework-ststm8spl\Libraries\STM8S_StdPeriph_Driver\inc -Isrc src\main.c
sdcc -o .pio\build\stm8s003f3\src\stm8s_clk.rel -c -mstm8 --debug --out-fmt-elf --opt-code-size -DF_CPU=16000000L -DPLATFORMIO=50101 -DSTM8S_003 -DSTM8S003 -DUSE_STDPERIPH_DRIVER -DUSE_STDINT -D__PLATFORMIO_BUILD_DEBUG__ -Iinclude -Isrc -IC:\Users\branderson.platformio\packages\framework-ststm8spl\Libraries\STM8S_StdPeriph_Driver\inc -Isrc src\stm8s_clk.c
sdcc -o .pio\build\stm8s003f3\src\stm8s_gpio.rel -c -mstm8 --debug --out-fmt-elf --opt-code-size -DF_CPU=16000000L -DPLATFORMIO=50101 -DSTM8S_003 -DSTM8S003 -DUSE_STDPERIPH_DRIVER -DUSE_STDINT -D__PLATFORMIO_BUILD_DEBUG__ -Iinclude -Isrc -IC:\Users\branderson.platformio\packages\framework-ststm8spl\Libraries\STM8S_StdPeriph_Driver\inc -Isrc src\stm8s_gpio.c
sdcc -o .pio\build\stm8s003f3\src\stm8s_it.rel -c -mstm8 --debug --out-fmt-elf --opt-code-size -DF_CPU=16000000L -DPLATFORMIO=50101 -DSTM8S_003 -DSTM8S003 -DUSE_STDPERIPH_DRIVER -DUSE_STDINT -D__PLATFORMIO_BUILD_DEBUG__ -Iinclude -Isrc -IC:\Users\branderson.platformio\packages\framework-ststm8spl\Libraries\STM8S_StdPeriph_Driver\inc -Isrc src\stm8s_it.c
sdcc -o .pio\build\stm8s003f3\src\stm8s_tim1.rel -c -mstm8 --debug --out-fmt-elf --opt-code-size -DF_CPU=16000000L -DPLATFORMIO=50101 -DSTM8S_003 -DSTM8S003 -DUSE_STDPERIPH_DRIVER -DUSE_STDINT -D__PLATFORMIO_BUILD_DEBUG__ -Iinclude -Isrc -IC:\Users\branderson.platformio\packages\framework-ststm8spl\Libraries\STM8S_StdPeriph_Driver\inc -Isrc src\stm8s_tim1.c
sdcc -o .pio\build\stm8s003f3\firmware.elf -mstm8 --nostdlib --code-size 8192 --iram-size 1024 --out-fmt-elf .pio\build\stm8s003f3\src\main.rel .pio\build\stm8s003f3\src\stm8s_clk.rel .pio\build\stm8s003f3\src\stm8s_gpio.rel .pio\build\stm8s003f3\src\stm8s_it.rel .pio\build\stm8s003f3\src\stm8s_tim1.rel -LC:\Users\branderson.platformio\packages\toolchain-sdcc\lib\stm8 -lstm8
I am seeing an issue debugging where it will pause at main, but then timeout. gdb says I can increase the timeout. I am able to pause and step with symbols though.
I’ll keep digging.