SparkFun MicroMod Data Logging Carrier Board with SparkFun MicroMod STM32 Processor

Hi,

I’ve been working on getting the SparkFun MicroMod STM32 Processor log data onto an SD card on the SparkFun MicroMod Data Logging Carrier Board. It keeps giving me the error “Initializing SD card…Card failed, or not present” I Believe its to do with this bit of code. “const int chipSelect = PC4; // The CS pin is DATA3 or 23 for the MicroMod Artemis Processor. Adjust for your processor if necessary.” I’ve looked everywhere and can’t seem to find the correct chip select. It can very well be another issue that I’m not aware of but at this point I’m not sure anymore. Thanks to anyone who looks over this and helps.

Best Regards,

Kevin

I haven’t tried the STM32 processor board on a data logging carrier board but I’ve used the ATP board and it should be wired up in a similar way for SD card usage.

I’ve used pins PA5-7 (SCK, CIPO, COPI) and PC4 (chip select) to access a micro-SD card successfully.

If you can get more debugging information out of the library you’re using, that would help you to diagnose the problem.

Hi dboddie,

Thank you for the information, I took a look through the library and set the SD card pins. This is all I could find and the only thing I could think of trying. It still had the same issue “Initializing SD card…Card failed, or not present”.

#define SDCARD_MOSI_PIN PA6

// spi poci

#define SDCARD_MISO_PIN PA7

// spi_sck

#define SDCARD_SCK_PIN PA5

// spi_CS#

#define SDCARD_SS_PIN PC4

const int chipSelect = PC4; // The CS pin is DATA3 or 23 for the MicroMod Artemis Processor. Adjust for your processor if necessary.

Shouldn’t MISO be PA6 and MOSI be PA7?

See the [schematic, especially the connections on the left hand edge of the processor.](https://cdn.sparkfun.com/assets/8/a/a/7/3/MicroMod_STM32_Processor.pdf?_gl=1*1r89mfl*_ga*MjkyNDYxMzUzLjE2ODg0MTU0MDM.*_ga_T369JS7J9N*MTY4OTcwMTkzOC4xOS4xLjE2ODk3MDE5NTMuMC4wLjA.)

I have been sucessfully using logomatic boards for datalogging for over 12 years. I thought it would be a good idea to try out some of the new sparkfun datalogging boards. I decided to use the SparkFun MicroMod Data Logging Carrier Board with SparkFun MicroMod STM32 Processor. My project is to build a magnetometer board. I have sucessfully designed and built several magnetometers using the RM3100 and the STM 32L152 Nucleo-64, with Arduino IDE. My issue with going via the STM32 micromod is that I am unable to get the processor to run the basic Blink program. I can download via DFU ok but nothing happens after download. NO BLUE LED BLINK. I will post the compiler message as there is a section I want to question.

***"Sketch uses 25132 bytes (2%) of program storage space. Maximum is 1048576 bytes.

Global variables use 4996 bytes (3%) of dynamic memory, leaving 126076 bytes for local variables. Maximum is 131072 bytes.


STM32CubeProgrammer v2.16.0


USB speed : Full Speed (12MBit/s)

Manuf. ID : STMicroelectronics

Product ID : STM32 BOOTLOADER

SN : 346C32613431

DFU protocol: 1.1

Board : –

Device ID : 0x0413

Device name : STM32F405xx/F407xx/F415xx/F417xx

Flash size : 1 MBytes (default)

Device type : MCU

Revision ID : –

Device CPU : Cortex-M4

Memory Programming …

Opening and parsing file: Blink.ino.bin

File : Blink.ino.bin

Size : 24.96 KB

Address : 0x08000000

Erasing memory corresponding to segment 0:

Erasing internal memory sectors [0 1]

sector 0000 does not exist

sector 0001 does not exist

Download in Progress:

File download complete

Time elapsed during download operation: 00:00:00.186

RUNNING Program …

Address: : 0x8000000

Start operation achieved successfully "

I found from a post on another forum that the message "sector 0000 does not exist

sector 0001 does not exist" indicates a problem. But that person didn’t describe the fix. So I am wondering what next - how do I progress this issue?

I would also suggest for newbies (me included) that the info on the Cube programmer is rewritten so that we have a better idea of what it is doing, and what we don’t need to do. I worried about it for many hours wondering whether I had to enter information to it. More examples would be good, especially on using SPI with the logger. Some of us oldies learn best by example!!

Thanks in advance.

Lockie (11873)

It’s been a while since I used my STM32 processor board, so I don’t remember if uploading a sketch causes it to run automatically. It looks like it does from the output you posted, but have you tried tapping the RST button to check whether or not it does on reset?

Hi,

I found the answer on stack exchange. The cube programmer V 2.16 has a bug. You need to revert to cube v2.15 to get the uploader to erase the flash memory correctly. This has happened many times before with different versions, something the STM programmers keep getting wrong.

My SparkFun MicroMod Data Logging Carrier Board with SparkFun MicroMod STM32 Processor now runs its RTC and display program on I2C correctly. However I am not sure how to address the SPI bus correctly. I can get the SD card to log time and date, but it cannot log the magnetometer on SPI as I am not sure of the label for the alternate chip select. More info from sparkfun would be a help.

I used PC4 for the SD chip select as suggested by dboddie, and PA4 for the magnetometer chip select.

Lockie

Is the table shown here of any help? https://learn.sparkfun.com/tutorials/mi … okup-guide

HI,

If I am not mistaken there is no second CS for SPI communication provided on this board, as Micromod bottom pin 70 is not connected on the STM32. This seems to be a serious oversight unless there is a work around.

Any help here?

Lockie

The Micromod Data Logging Board information states: "Data Logging Connections

Along with the Qwiic connector mentioned in the Common Components, the Data Logging Carrier Board breaks out several other pins to connect UART, SPI and other I/O devices. The primary SPI pins are netted to the µSD slot and a PTH header near the LiPo battery connector. A second Chip Select pin tied to G0 is broken out to that same header."

I have looked closely at the board and cannot find where G0 is broken out to that PTH header. There is no lable for G0 on that header. Maybe that information may have been referring to the standard carrier board.

I hope Sparkfun Techs can clear this up.

Looking at the schematic, pin G0 (signal name ~HEADER_CS) can be found on J12p5 (SPI header). This is the pin labelled “~CS” right above the LiPo connector.

/mike

Thanks Mike,

Looking at the schematic I believe you are correct. I would’t have guessed though without your help. The MicroMod general pinout table does not help here either. What would have been helpful would have been an SPI_CS table that gave:

SPI_CS# ; pin55 ; STM32 pinout label PC4 (reserved for microSD)

SPI_CS1#; pin 70 ; Not Connected; (In case one was mislead to thinking this could be used)

G0; pin 40 ; STM32 pinout label PD2; SPI_CS header available on PTH header.

My problem is now solved and the SPI magnetometer is working fine and logging nicely onto the SD card!!

Lockie

I am still bugged about this topic. That is what are the correct pin lables? I want to try out my STM32 Thing Plus board and I have the same issues - what are the lables to use ! The silkscreen has D3, D5, D9,D10, D11, D12, D13, and A0,A1, A2, A3,A4,A5 But I cannot find much information on their programming names. The STM32 hookup guide Gives PC0 for D0 and PC1 for D1. It also has confusing terms such as POCI and PICO whereas the silkscreen has CIPO and COPI (MISO and MOSI). Surely this is a mistake in the documentation. Also what is the SPI CS pin designation for the Thing Plus SD card? This sort of information needs to be provided for the Thing Plus.
Lockie

I purchased two more STM32 Micromod boards. The first one just wasn’t recognised at all and thus was unable to be programmed while the second one was recognised OK and had the blink program uploaded sucessfully, according to the Arduino STM32 Cube 2.15 programmer, but failed to execute the program and blink the LED. A third STM32 MM board worked fine. Getting two dud boards out of three is not a good number. Has anyone else had a board that loads the program OK but then fails to execute? I tried a few different programs. Having a working board has been helpful since I can try that one as well.

I think I need a Sparkfun’s technical advice here. I purchased a further STM32 MM board and I am having the same issues - I cannot get the blink program to run and I cannot get the I2C program to find the RTC and the OLED, yet if I run the same program on the Thing Plus with the same peripherals it recognises them OK. My first STM32 MM board (a V1.0) also works fine as well, but the next three (from two different suppliers) are not working. I have ruled out the software, I have ruled out the carrier board, so what is left? One module just was not recognised at all (obviously faulty), and two that programmed OK but do not run correctly. I am using the Cube programmer V2.15, (as I noted earlier V2.16 does not do the memory erase). I am not getting any error messages - just programs that fail to find the SPI or I2C bus.
Help please.
Lockie