Is STM32F7508-DK board supported?

It looks like that STM32F7508-DK board is supported (STM32F7508-DK — PlatformIO latest documentation). I customized cmis-blink example (given here http://github.com/platformio/platform/raw/master/examples/cmsis-blink/platformio.ini) and ran pio run but ran into the following:

[dilawars@chutki cmsis-blink (develop)]$ pio run
Processing disco_f750n8 (platform: ststm32; board: disco_f750n8; framework: cmsis)
-----------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/disco_f750n8.html
PLATFORM: ST STM32 (11.0.0) > STM32F7508-DK
HARDWARE: STM32F750N8H6 216MHz, 340KB RAM, 64KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES: 
 - framework-cmsis 2.50501.200527 (5.5.1) 
 - framework-cmsis-stm32f7 1.2.5 
 - tool-ldscripts-ststm32 0.1.0 
 - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/disco_f750n8/FrameworkCMSIS/gcc/startup_stm32f750xx.o
Compiling .pio/build/disco_f750n8/FrameworkCMSIS/system_stm32f7xx.o
Compiling .pio/build/disco_f750n8/src/main.o
src/main.c: In function 'main':
src/main.c:107:5: error: 'ENABLE_GPIO_CLOCK' undeclared (first use in this function)
     ENABLE_GPIO_CLOCK;              // enable the clock to GPIO
     ^~~~~~~~~~~~~~~~~
src/main.c:107:5: note: each undeclared identifier is reported only once for each function it appears in
src/main.c:108:5: error: 'LEDPORT' undeclared (first use in this function)
     LEDPORT->_MODER |= GPIOMODER;   // set pins to be general purpose output
     ^~~~~~~
src/main.c:108:24: error: 'GPIOMODER' undeclared (first use in this function)
     LEDPORT->_MODER |= GPIOMODER;   // set pins to be general purpose output
                        ^~~~~~~~~
src/main.c:111:25: error: 'LED1' undeclared (first use in this function)
     LEDPORT->ODR ^= (1<<LED1);  // toggle diodes
                         ^~~~
*** [.pio/build/disco_f750n8/src/main.o] Error 1

My platformio.ini is following

[env:disco_f750n8]
platform = ststm32
board = disco_f750n8
framework = cmsis

Any pointers?

best,
Dilawar

The link is dead.

I think you mean platform-ststm32/examples/cmsis-blink at develop · platformio/platform-ststm32 · GitHub.

If you are using the code from

You can see that it has these custom #ifdef STM32F7 etc blocks. These get activated by defining that macro in the environment for the specific microcontroller.

E.g.

So either use a platformio.ini like

[env:disco_f750n8]
platform = ststm32
board = disco_f750n8
framework = cmsis
build_flags = -DSTM32F7

And the thing will compile.

Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\disco_f750n8\FrameworkCMSIS\gcc\startup_stm32f750xx.o
Compiling .pio\build\disco_f750n8\FrameworkCMSIS\system_stm32f7xx.o
Compiling .pio\build\disco_f750n8\src\main.o
Linking .pio\build\disco_f750n8\firmware.elf
Building .pio\build\disco_f750n8\firmware.bin
Checking size .pio\build\disco_f750n8\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 28 bytes from 348160 bytes)
Flash: [          ]   0.5% (used 344 bytes from 65536 bytes)
=========================== [SUCCESS] Took 1.84 seconds ===========================

Or, just delete all condition ifdef blocks except the STM32F7 and then make it unconditional, aka just the main.c as

#include "stm32f7xx.h"
#define LEDPORT (GPIOB)
#define LED1 (0)
#define ENABLE_GPIO_CLOCK (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN)
#define _MODER    MODER
#define GPIOMODER (GPIO_MODER_MODER0_0)

void ms_delay(int ms)
{
   while (ms-- > 0) {
      volatile int x=500;
      while (x-- > 0)
         __asm("nop");
   }
}

//Alternates blue and green LEDs quickly
int main(void)
{
    ENABLE_GPIO_CLOCK;              // enable the clock to GPIO
    LEDPORT->_MODER |= GPIOMODER;   // set pins to be general purpose output
    for (;;) {
    ms_delay(500);
    LEDPORT->ODR ^= (1<<LED1);  // toggle diodes
    }

    return 0;
}
2 Likes

Thanks. I should have looked under the hood a bit. Setting build flags did the trick.