since a view days I’m using the STM32F4 Discovery with the Arduino software. But I got a little confused about what to install.
The first thing I did was copying this repository
https://github.com/rogerclarkmelbourne/Arduino_STM32
into the Arduino hardware folder. And I used also the Arduino IDE 1.6.9.
But there is no I2C and no support for the peripherals. Now I found a second repository:
https://github.com/stm32duino/Arduino_Core_STM32F4
This seems to be more advanced.
What is the best way to install this board? Is it now possible to use a IDE newer than 1.6.9?
Thank you in advance for your comment.
There is a file with some board specific description:
https://github.com/stm32duino/Arduino_C … /variant.h
Wouldn’t it be better to have some definitions with which you can directly access the pins with digitalWrite like this:
#define USERBUTTON PA0
#define GREENLED PD12
#define ORANGELED PD13
#define REDLED PD14
#define BLUELED PD15
#define REDLEDOTGOVERCURRENT PD5
#define MICROPHON_CLK_INPUT PB10
#define MICROPHON_PDMDATA_OUTPUT PC3
#define NUMLEDS 5
const uint8_t Led[] = {GREENLED, ORANGELED, REDLED, BLUELED, REDLEDOTGOVERCURRENT};
void setLed(uint8_t n, uint8_t state)
{
if(n==4)digitalWrite(Led[n], !state);
else digitalWrite(Led[n], state);
}
void setup()
{
for (int n = 0; n < NUMLEDS; n++) pinMode(Led[n], OUTPUT);
pinMode(MICROPHON_CLK_INPUT, OUTPUT);
}
void loop()
{
for (int n = 0; n < NUMLEDS; n++)
{
setLed(n, HIGH);
delay(100);
setLed(n, LOW);
delay(100);
}
}
there are a few F4 Discovery boards, browse in the F4 forums.
the limitations of assorted F4 cores are (perhaps overly) discussed in the F4 forums.
OT – examples, HAL plenty, also unicore-mx-examples (SPL wrapper), libopencm3-examples (SPL wrapper)
if you want to go the HAL and bare metal route, look at CubeMX & System Workbench Ac6 from ST
stephen
I want to use exactly this board: STM32F4 Discovery
Because the newest work relating to this board happens in this repository I need someone who knows how to install it. The explanations in this Wiki do not work. Probably they are outdated and related to this older repository.
So I need someone who knows how.
But there is no I2C and no support for the peripherals.
Using Roger’s repository, you can simply copy the Wire library from STM32F1 into STM32F4, or even create a symbolic link.
It is what I’m using since almost 2 years.
Thank you very much. That’s a good hint. I wonder why Roger is not copying the library itself in the repository.
My goal is to use the codec to create some sounds with the STM32F4 discovery boards.
Can me point to some code example?
The user “mubase” is using this version. But it is a software I2C and somehow mixed up.
Another question would be: How is this second repository related to Rogers work. There seems to be a lot of development going on.
The new repository is owned by Roger, but it is used by STM employees, so the authors are working at STM.
About I2C code, I personally using basic examples, such as Adafruit_MCP23017 or extEEPROM, I’ve never used any I2C Codec.
About I2C code, I personally using basic examples, such as Adafruit_MCP23017 or extEEPROM, I’ve never used any I2C Codec.
That’s a pity because the STM32F4 discovery has this interesting peripherals:
– MP45DT02 ST-MEMS-Microphone
– Audio-DAC CS43L22 with class D amplifier
– 3-Achsen-ST-MEMS-accelerometer
and I thought I can easily use them with the Arduino Environment.
Meanwhile I found the discussion branch where they discuss the development of the new coreF4
There are now examples for different peripherals of the board:
– LEDs example
– Button Example
– Accelerometer example
– Audio Codec example
Here is my example repo. Usually Daniel is pulling it after a while. Us his repo, if you can find the example there because it might be from a “core” point of view newer.
There are now examples for different peripherals of the board:
– LEDs example
– Button Example
– Accelerometer example
– Audio Codec example
Here is my example repo. Usually Daniel is pulling it after a while. Us his repo, if you can find the example there because it might be from a “core” point of view newer.
Unfortunately, no.
The serial terminal show constant values.
The red led is bright.
The green led is weak.
My board seems to have the “L” version of the MEMS:
accelerometer
INFO1 register: 0
INFO2 register: 0
WHO AM I register: 3B LIS3DSL sensor detected
My board seems to have the “L” version of the MEMS:
accelerometer
INFO1 register: 0
INFO2 register: 0
WHO AM I register: 3B LIS3DSL sensor detected
I just added a basic sample player to my repo which plays to samples in random manner.
It lets room for a lot of artistic creativity.
Could you try it on your board an give me feedback how it is working?
My first example is playing a sine wave with a BufferPlayer class.
Now sound creation is really simple