STM32 Discovery kit Iot Node and Arduino

Post here first, or if you can't find a relevant section!
Post Reply
tonyd
Posts: 3
Joined: Sat Jul 23, 2022 12:28 pm

STM32 Discovery kit Iot Node and Arduino

Post by tonyd »

Hi All

I bought this board a couple of years ago and have just got around to playing with it. The MCU is a STM32L475 and the chip has VGT6 stamped on it.

I went through a ST tutorial of using the STMCubeIDE and STMCubeMX to flash the LED and that works fine, so I think the toolchain is OK

I decided to try some programming through the Arduino IDE , to play with the built in sensors and maybe attach the board to Blynk. I found the board library on github (https://github.com/stm32duino/BoardMana ... index.json) and installed that. The library exposed the boards as excepted and I chose Generic STM32L4 series and part number L475VGTx . When the libraries where installed, you get some sample code and I chose BarometricPressureSensor. The code compiles OK and uploads to the board, but there is no output to the serial monitor. I am sure the code loads OK as the LED stopped blinking (from ST tutorial)
The compiler output is
-------------------------------------------------------------------
STM32CubeProgrammer v2.11.0
-------------------------------------------------------------------

ST-LINK SN : 066FFF3736324D5043224537
ST-LINK FW : V2J40M27
Board : STM32L4IO
Voltage : 3.22V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x415
Revision ID : Rev 4

Device name : STM32L4x1/STM32L475xx/STM32L476xx/STM32L486xx
Flash size : 1 MBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : --
Debug in Low Power mode enabled

Memory Programming ...
Opening and parsing file: BarometricPressureSensor.ino.bin
File : BarometricPressureSensor.ino.bin
Size : 25.29 KB
Address : 0x08000000

Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 12]
Download in Progress:

File download complete
Time elapsed during download operation: 00:00:00.916

RUNNING Program ...
Address: : 0x8000000
Application is running, Please Hold on...
Start operation achieved successfully

I have left the rest of the tool settings at the default for this board. The code has a conditional output to the serial monitor, thus

Code: Select all

// don't do anything until the data ready pin is high:
  if (digitalRead(dataReadyPin) == HIGH) 

To ensure the problem was not the pin being held LOW, I added an unconditional write to the console in Setup(), thus

Code: Select all

 Serial.println("Starting...");
Can anyone tell me what I am doing wrong?

Thanks
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32 Discovery kit Iot Node and Arduino

Post by fpiSTM »

You have to select the board in discovery menu not generic.
Part number: B-L475E-IOT01A
tonyd
Posts: 3
Joined: Sat Jul 23, 2022 12:28 pm

Re: STM32 Discovery kit Iot Node and Arduino

Post by tonyd »

Thanks @fpiSTM

I changed the board/part number as suggested. The download to the MCU was successful, but I had the same result, i.e. no output to the serial monitor.

I thought I'd try something simpler, so downloaded the blink sketch using the discovery settings and that worked, the LED blinked. To be certain I re-downloaded the BarometricPressureSensor sketch to reset the LED and then re-downloaded the blink sketch using the generic board. That downloaded successfully but the LED did not blink. So I now know, as you suggested, I have to use the discovery board. Thanks for putting me straight there. I will look closer at the example BarometricPressureSensor sketch to see if there is anything odd going on, maybe add some delays.

tony
tonyd
Posts: 3
Joined: Sat Jul 23, 2022 12:28 pm

Re: STM32 Discovery kit Iot Node and Arduino

Post by tonyd »

OK, I can get data to the serial monitor, I just reversed the test that determines whether or not to read the sensors and output to the monitor.

So is used to say

Code: Select all

  // don't do anything until the data ready pin is high:
  if (digitalRead(dataReadyPin) == HIGH) {
    //Read the temperature data
    int tempData = readRegister(0x21, 2);
and I changed it to

Code: Select all

  // don't do anything until the data ready pin is high:
  if (digitalRead(dataReadyPin) == LOW  ) {
    //Read the temperature data
    int tempData = readRegister(0x21, 2);
Whilst I can get the sketch to output data, the data is rubbish, temp = 3276.7511111, which is suspiciously like 32767 divided by something. I will have to try and find out what is supposed to pull the pin HIGH
User avatar
gojimmypi
Posts: 1
Joined: Sun Jan 28, 2024 11:05 pm
Location: California
Contact:

Re: STM32 Discovery kit Iot Node and Arduino

Post by gojimmypi »

Is the B-L475E-IOT01A WiFi library still available for Arduino? I could not find it in http://dan.drown.org/stm32duino/package ... index.json.

Also, I was unable to get the Serial.println() to work for Arduino, with the USB cable plugged into the J-Link USB port.

However, I was able to get Serial4.println() working by using an external USB/TTY device:

D1 on PCB silkscreen; A1: Transmit, push/pull
D0 on PCB silkscreen; A0: Receive, open drain

I'm curious how you were able to get the standard Serial.println() to work.
Post Reply

Return to “General discussion”