how do I configure GPIO software for STM32F091RC?

21 Oct 2016

mbed is fantastic! I used mbed online IDE to bring up my software up on NUCLEO F091RC.

Where in mbed library does it configure GPIO?

I exported my mbed project to VisualGDB, and need to modify the software to work with my target board, which I just got from the fab (hurrah!).

Thanks.

Doug

24 Oct 2016

Doug,

I am struggling to understand your question. Can you elaborate? For gpio issues, the mbed api uses objects like DigitalIn, DigitalOut, InterruptIn, etc. Are you talking about one of those?

I have been using mbed-os offline in the eclipse based System Workbench from ST, so that's the perspective I'm coming from. Getting everything setup was kind of a pain, but things are pretty much working now. I have also had more luck creating offline projects with the mbed-cli tool, rather than exporting from the online compiler. Mbed-cli also makes it easy to keep mbed-os files udpated. The exports from online compiler were broken a couple months ago, but it's possible they are working now, I don't know. The export has also traditionally not provided the full mbed-os source either.

I have also made my own target board, and it has been pretty much seamless getting mbed running on that. I haven't had to change anything in any of the source files yet.

You believe you can get a toolchain working in VisualGDB? There are obviously many software components that need to come together to have a full functioning development environment.

Did you download the mbed-os source files? Any question about the mbed pin configurations can be answered by drilling down into all the source files. Stepping through startup in debug mode is also enlightening.

Graham

15 Nov 2016

Thanks, Graham.

Specifically, how do I set pull ups or pull downs or fast mode? 1. My hardware engineer wants me to set my two I2C MCU pins for pull-up and fast mode. 2. And he wants me to set my general GPIO pins to pull-down. 3. Lastly, he wants all unused MCU GPIO pins set to 'analog input.' CUBE MX has a setting for this.

Yes. Here's init code so far: static DigitalIn board_user_button( USER_BUTTON_GPIO2_INPUT ); static DigitalOut decision_output( DECISION_GPIO1_OUTPUT, DECISION_OUTPUT_NORMAL ); static DigitalOut green_LED( GREEN_LED, 0); off at boot static DigitalOut red_LED( RED_LED, 0); off at boot

VisualGDB is fantastic. Their new project wizard supports mbed import and mbed's ARM toolchain. VisualGDB has tutorial for mbed import. Now I'm debugging with Visual Studio my embedded target. In my 35 years doing this, this is one of the strongest developments. Just export an mbed program to GCC (ARM embedded), import to VisualGDB, and it's running on your eval board (NUCLEO-F091RC in my case), or your target, after GPIO re-mapping.