Page 3 of 3

Re: SensorTile

Posted: Wed Nov 01, 2017 7:04 pm
by oneselflost
I toght you've put PG_12 next to PG12 in variant.h
- No, those are comments next to the PxX in variant.h
Did you add PG12 in variant.h before PEND ?
- Yes

Re: SensorTile

Posted: Wed Nov 01, 2017 9:29 pm
by fpiSTM
Check quickly, your update is correct but the LED is on when PG12 is High.
It is linked to SAI_SD of the SensorTile, so if it is set to low by it then the led will be always off.

Note: using PG_12 in the sketch is not correct as it is the PinName not the pin number.

One other try which could be done is to use directly the ST HAL, this bypass all Arduino API:

Code: Select all

void setup() {
  GPIO_InitTypeDef gpio_init_structure;

  /* Configure the PG12 pin */
  gpio_init_structure.Pin = GPIO_PIN_12;
  gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
  gpio_init_structure.Pull = GPIO_PULLUP;
  gpio_init_structure.Speed = GPIO_SPEED_HIGH;

  HAL_GPIO_Init(GPIOG, &gpio_init_structure);

// the loop function runs over and over again forever
void loop() {
  delay(1000);                       // wait for a second
  delay(1000);                       // wait for a second
One other clue should be to check solder bridge. Sometime there is some ambiguous configuration :roll:
I'm currently on vacation, so check that next week.

Re: SensorTile

Posted: Thu Nov 02, 2017 2:34 am
by oneselflost
I tried code to use the ST HAL directly, and sure enough, it didn't work.

Looking through the schematic and the MEMS example provided by ST, it looks like the SAI_SD is connected to an audio chip. That said, I am leaving alone PG12 for now :lol:

Moving along though - PC0, PC1, and SWD pins all blink happily! A nice surprise after a little frustration :)

I am going to need to make my own variant in order for anything to be intuitive here.. And so the project commences!

Re: SensorTile

Posted: Thu Nov 02, 2017 7:46 am
by fpiSTM
Referring to the User manual, page 10: ... 320099.pdf

For PG12, Logic level of this pins is referred to VDDIO2.
Power supply
The SensorTile board has the following input supply pins:
1. VIN is the input for the onboard voltage regulator generating 1.8 V (150 mA max).
2. VDDUSB is an input for the STM32L4 VDDUSB and VDDIO2 pins (to use the
STM32L4 USB OTG peripheral, VDDUSB must be ≥ 3 V)
which power supply you use?

Re: SensorTile

Posted: Thu Nov 02, 2017 11:10 am
by oneselflost
I am powering via USBVDD - The LED does work when the ST ALLMEMS1 example is loaded.

Re: SensorTile

Posted: Wed Nov 29, 2017 9:16 am
by cparata
Regarding the MEMS sensor libraries for SensorTile, unfortunately the MEMS sensor libraries currently available on stm32duino repository support only the I2C interface. These MEMS sensor libraries can be easily extended to support the SPI 4-Wires (we just need to add a new constructor with SPI instance and 2 new implementations for IO_Read and IO_Write methods). On Sensortile, instead, the MEMS sensors are connected with SPI-3-Wires interface (it means that MISO pin is not connected and the MOSI pin is used as to transmit as to receive data to/from device). So, in order to support SPI 3-Wires we need to extend the SPI class in the STM32 Cores in order to implement also this functionality. After that, it should be possible to extend the MEMS sensor classes to support SPI 3-Wires bus as well.