I'm still tinkering with ChibiOS and the ARM platform, but for 2 straight days I haven't been able to fix this problem, and I exhausted everything I though of and searched over google and this forum trying to debug this problem.
I'm trying to do the simplest thing in the world, build a demo, I tried the Olimex P103 and the stm103rb Nucleo as they are the ones closest to this board I have with an STM32F103C8T6, and I haven't been able to get the led blink, and yes, I made sure the connections are ok, and the code is effectively trying to toggle the correct port where the led is connected (I had to change Olimex port since I have no port C in this board).
The fun thing is, I tried a demo (third party demo of someone who made a USB CDC Serial demo with this board actually) and the USB serial works perfectly, has it's shell configured, and the test run all flawlessly ! In that same demo, I can't blink an led, but the USB serial still works, which makes me believe this is a problem related only to the PAL subsystem, I even pondered that the MCU was defective, until I built a bare demo using only CMSIS and the Std Peripheral lib from STM32 (STM32F10x_StdPeriph_Lib_V3.5.0), I also was careful to configure this test with the Std Periph library with the same clock that the ChibiOS demos I tried configured, which was 72mhz using external osc of 8mhz and it works, the led blink as it's expected to.
Now, I'm not an expert in GDB debugging, hell I'm not an expert in debugging at all except for the usual print or other type of signaling throughout the code, so I had to learn a bit of it in order to try and debug this, but I'm still inexperient so give me some slack there
To make it easier for me (although I'm used to emacs and command line while developing) I installed eclipse, chibios plugin on eclipse, CDT and all the required stuff to be able to debug the project in the eclipse and try to figure out the problem, when today, a little bit ago actually, while debugging again one of this demos, I hover the function palSetPad and palClearPad, where show they are a Macro, and show it's expansion to:
Code: Select all
do { \
(void)GPIOA; \
(void)GPIOA_LED_GREEN; \
} while (false)
Now, I imagine this is a common default code where it's later defined by the proper implementation given the correct architecture, so far so good, but, I would expect eclipse would properly follow that and show me the correct define for the arch I'm using wouldn't it be correct ? if so, that's probably why my led isn't blinking, it's pal defines are not being made correctly !?
If it's actually normal for eclipse to not show the correct macro expansion here, then I'm still clueless about why this doesn't work :/
I tried the stock demos:
RT-STM32F103-OLIMEX_STM32_P103
RT-STM32F401RE-NUCLEO
Only thing changed in those demos was in the OLIMEX board the pin where the LED is on, to GPIOB 0
The bare example I tested and worked is this template in github:
https://github.com/geoffreymbrown/STM32-Template
The code I used is here http://pastebin.com/51fFhamf and I made sure in:
CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.c
that the clock selected was SYSCLK_FREQ_72MHz to match the demos.
Help ?
Best regards,