Page 1 of 1

STM32 GPIOE and debugging problems

Posted: Mon Nov 12, 2012 11:45 pm
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

Re: STM32 GPIOE and debugging problems

Posted: Tue Nov 13, 2012 7:14 am
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 ;-)

Re: STM32 GPIOE and debugging problems

Posted: Tue Nov 13, 2012 8:55 am
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

Re: STM32 GPIOE and debugging problems

Posted: Tue Nov 13, 2012 6:15 pm
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 8073 times

Re: STM32 GPIOE and debugging problems

Posted: Tue Nov 13, 2012 6:50 pm
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

Re: STM32 GPIOE and debugging problems

Posted: Tue Nov 13, 2012 8:27 pm
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.

Re: STM32 GPIOE and debugging problems

Posted: Fri Nov 16, 2012 2:34 pm
by tkj
Bump

Any suggestions on the debugging problem?

Re: STM32 GPIOE and debugging problems

Posted: Fri Nov 16, 2012 2:59 pm
by mabl
Could you provide all the logs you can find? Especially the logs from your jlink gdb server.