Posts

Showing posts from July, 2021

Blackmagic + gdbgui

Image
 Sometimes it really helps to have a nice GUI for GDB Finding an IDE that supports *correctly* remote gdb debugging as used with Arm or RiscV boards is difficult. There is one option that seems to work ok :  gdbgui The principle is that the UI is actually your favorite browser How to start it easily with the backmagic ? 1- create a blackmagic gdb init script target extended-remote /dev/ttyBmpGdb monitor connect_srst enable monitor swdp_scan attach 1 load compare-sections set mem inaccessible-by-default off set confirm off 2- start gdbgui through a small shell script #!/bin/bash export F=$PWD/$@ echo "Loading $F" gdbgui -g "/home/fx/Arduino_stm32/arm-gcc-2020q4/bin/arm-none-eabi-gdb-py3 -x /home/fx/blackmagic.gdb ${F}" (you'll need to adapt those 2 scripts for your configuration : path to gdb, path to blackmagic.gdb, device to use etc...) then bash ~/gdbgui.sh myelf.elf and it starts.  A small warning, i have to go to the output panel and press enter or else it...

GD32F1, GD32VF103 why should i bother ?

Image
It's not secret, i rather like the GD32xx chips. They work fine, the doc is ok (not great but ok) and they have a riscv based one that works very well. So i started writing lnArduino, i.e. running an Arduino style API on the riscv GD32VF103 chip as found on the Longan Nano. And then i wondered : Why should i care if it is an arm core or a riscv core ? The peripherals are mostly the same between the GD32F1/F3 and the GD32VF1 So i started adding support for Arm core (only GD32F1, GD32F3, and to some extend STM32F1) It is surprisingly simple to do, once you get through the base ones (boot, interrupts, freeRTOS) that are nasty. So for the features that are done, i can build the *same* code on a longan nano and on bluepill with a GD32F1 chip.  Only one line to change to select the MCU/Architecture in the CMakelist and that's it. "But i can do that with the Arduino API" you might think Sure thing, but you dont have the code & drivers written with FreeRTOS available out ...

Longan nano simple signal generator : Demo

Image
It's just a toy but it works : sine, triangle, square from 10 hz to 100 khz The aim is mainly to use the lnArduino framework and makes sure it works (it does!) Youtube demo   Source code : https://github.com/mean00/longan_nano_signal_generator