7 years, 8 months ago.

When I Use the SPI driver and Can't control GPIO Inpuits

I can no longer get gpio pins on different spi channels to operate as gpio.

Example using: SPI spi(P4_6, P4_7, P4_4);

I can no longer get toggle = new DigitalOut(P1_2); toggle = 1; toggle = 0;

It works until I call.... spi.format, spi.frequency or spi.write After that it stops working....?

Question relating to:

GR-PEACH is an Mbed enabled platform which combines the advantages of the Mbed ecosystem and Arduino UNO form factor.

Steven please let us know if you are using mbed5.0 or "classic" mbed thank you.

posted by XtrmDesignsLLC GRPeach 04 Aug 2016

No idea on whether mbed5.0 or classic. Everything was recently exported from the tip version on library. When I turn off the compiler optimizations completely (I was optimizing -Os) it seems to work - I think somehow there is a deallocation going on that should not. we were statically allocating the SPI and the pins, and assigning them to pointers which we dereferenced later...it crashes when we dereference with optimizations on... but not when they are off..

posted by Steven Root 04 Aug 2016

Steven please advise if you have a rev. b or newer board - here is a bug fix related to SPI GPIO clocking and rev b boards - https://developer.mbed.org/teams/Renesas/code/mbed-src_GR-PEACH_rev_b/rev/fa203361dc70

posted by XtrmDesignsLLC GRPeach 04 Aug 2016

I am using a rev C board

posted by Steven Root 04 Aug 2016

Steven so the know issues: https://developer.mbed.org/teams/Renesas/wiki/Known-issues-of-GR-PEACH and SPI: https://developer.mbed.org/handbook/SPI - which I apologize if you have already reviewed - I am checking with the 5/2016 code change engineering team to see if there are any other fixes or work-arounds.

posted by XtrmDesignsLLC GRPeach 04 Aug 2016

1 Answer

7 years, 8 months ago.

Hi Steven Root,

P1_0-P1_7 are open drain outputs. Please close the JP14, or use the other pin.
https://developer.mbed.org/teams/Renesas/wiki/Jumper-settings-of-GR-PEACH

understood... I have JP14 and JP15 both installed I have bypassed the allocation problems by changing where the new is called relative to the port pins....

posted by Steven Root 08 Aug 2016