STM32 GPIOE and debugging problems

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
tkj
Posts: 11
Joined: Tue Oct 30, 2012 11:46 pm

STM32 GPIOE and debugging problems

Post by tkj »

Hi all ChibiOS users.
I have just started testing the ChibiOS RTOS system and have sucessfully got both Ethernet, PWM and other things to work at our STM32-E407 board from Olimex, featuring an STM32F407ZG chip.

My only problem currently is that I can't seem to get the GPIOE port working, the one used on D2-D5 output pins.

I have initialized the output with "palSetPadMode(GPIOE, 2, PAL_MODE_OUTPUT_PUSHPULL);"
But then when I try to toggle the output, or even set or clear the bit, nothing happens. The output stays at a high or floating level.

Any suggestions why this happens?

Next problem is about JTAG Debugging. We got a J-Link adapter which integrates (using GDB) with CooCox CoIDE (which is the IDE we are using).
Sometimes debugging works without any issues but suddenly it NEVER works.
All the time when we try to start a debugging session the code execution is started (the on-board LED blinks), but the program isn't and the address pointer set/held at "main()" as it should - waiting for the user to press "Go".
Instead Eclipse says "No source available for """ and a button saying "View disassembly" which gives absolutely nothing. So to me it seems like the JTAG reset isn't done properly and the processor dislodges from the debugging session.

And yes, we have followed the debugging guide but it didn't change anything at all.

Thanks a lot.

Best Regards
Thomas Jespersen
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32 GPIOE and debugging problems

Post by mabl »

About not being able to debug anymore:
You might have messed up the pin configuration, either by a wrong board file, or by flashing a wrong image (happened to me when flashing a discovery image on the E407) - your JTAG port might get disabled.

To recover into a working state, boot into the onboard bootloader by switching the B0_1 bit on the E407 (lower right corner) and see if it starts to work again.

Otherwise, debug output from jlink gdb server will probably also help you ;-)
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32 GPIOE and debugging problems

Post by Giovanni »

Hi,

Could you verify the values in the GPIO registers after executing palSetPadMode(GPIOE, 2, PAL_MODE_OUTPUT_PUSHPULL)? this will tell us if the port has been correctly programmed, if not then it must be something not related to port setup.

Giovanni
tkj
Posts: 11
Joined: Tue Oct 30, 2012 11:46 pm

Re: STM32 GPIOE and debugging problems

Post by tkj »

Giovanni wrote:Hi,

Could you verify the values in the GPIO registers after executing palSetPadMode(GPIOE, 2, PAL_MODE_OUTPUT_PUSHPULL)? this will tell us if the port has been correctly programmed, if not then it must be something not related to port setup.

Giovanni

Ok, I would like to give you this information but how am I supposed to do that when debugging isn't working.
I can program the chip - and the chip is also successfully programmed when clicking the debugging button (using GDB). But when it has been programmed and waits for the processor to halt, it gives me the mentioned error.

A screenshot of the error can be seen below.
debugging_error.png
debugging_error.png (143.29 KiB) Viewed 8070 times
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32 GPIOE and debugging problems

Post by Giovanni »

That debugging problem is not something I can address :( I don't have any experience with Jlink, are you using OpenOCD as GDB server? it can be tricky to setup properly.

Giovanni
tkj
Posts: 11
Joined: Tue Oct 30, 2012 11:46 pm

Re: STM32 GPIOE and debugging problems

Post by tkj »

Giovanni wrote:That debugging problem is not something I can address :( I don't have any experience with Jlink, are you using OpenOCD as GDB server? it can be tricky to setup properly.

Giovanni

No, I'm using the JLink ODB Server which you have to point at in the debugging settings.
tkj
Posts: 11
Joined: Tue Oct 30, 2012 11:46 pm

Re: STM32 GPIOE and debugging problems

Post by tkj »

Bump

Any suggestions on the debugging problem?
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32 GPIOE and debugging problems

Post by mabl »

Could you provide all the logs you can find? Especially the logs from your jlink gdb server.
Post Reply