SensorTile

The official STMicroelectronics Arduino core
oneselflost
Posts: 27
Joined: Mon Jul 24, 2017 2:32 am

Re: SensorTile

Post by oneselflost » Wed Nov 01, 2017 7:04 pm

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

fpiSTM
Posts: 250
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: SensorTile

Post by fpiSTM » Wed Nov 01, 2017 9:29 pm

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;
  __HAL_RCC_GPIOG_CLK_ENABLE();

  /* 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() {
  HAL_GPIO_WritePin(GPIOG, GPIO_PIN_12, GPIO_PIN_SET);
  delay(1000);                       // wait for a second
  HAL_GPIO_WritePin(GPIOG, GPIO_PIN_12, GPIO_PIN_RESET);
  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.

oneselflost
Posts: 27
Joined: Mon Jul 24, 2017 2:32 am

Re: SensorTile

Post by oneselflost » Thu Nov 02, 2017 2:34 am

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!

fpiSTM
Posts: 250
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: SensorTile

Post by fpiSTM » Thu Nov 02, 2017 7:46 am

Referring to the User manual, page 10:
http://www.st.com/resource/en/user_manu ... 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?

oneselflost
Posts: 27
Joined: Mon Jul 24, 2017 2:32 am

Re: SensorTile

Post by oneselflost » Thu Nov 02, 2017 11:10 am

I am powering via USBVDD - The LED does work when the ST ALLMEMS1 example is loaded.

cparata
Posts: 3
Joined: Wed Nov 08, 2017 1:42 pm

Re: SensorTile

Post by cparata » Wed Nov 29, 2017 9:16 am

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.

Post Reply