SensorTile

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

SensorTile

Post by oneselflost » Sun Oct 29, 2017 8:28 pm

Has anyone had any luck getting the ST SensorTile working with Arduino IDE?

I know it uses an STM32L476, which is supported by STM32duino, but I haven't even been able to get the LED to blink, even after adding the proper pin to the variant file.

Any help is greatly appreciated.

User avatar
RogerClark
Posts: 7540
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: SensorTile

Post by RogerClark » Sun Oct 29, 2017 9:48 pm

Moved this thread to the STM core, so perhaps Frederic from STM can comment

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

Re: SensorTile

Post by fpiSTM » Mon Oct 30, 2017 7:01 am

Hi oneselflost,

I don't know/have this kit (I don't know (yet ;) all the ST portfolio).
This is currently not planned to add it. I could help you if you want to add it.
some of the components are supported with Arduino libraries (LPS22HB, MP34DT04 (on going), ...)
Anyway, I think, It should be possible to use the Nucleo-L476RG variant to add basic support.
Maybe the clock config is not correct that's why the led is not blinking

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

Re: SensorTile

Post by oneselflost » Mon Oct 30, 2017 3:59 pm

Thank you for the reply!

Its a very capable little board, I'm looking forward to digging into it more. Incredible how much is crammed on that little tile. I'd love to add some basic support for this board - hopefully others could benefit from it as well.

Looking at the variant folder a little closer, it looks like I need to add the LED pins (PA14, and PG12) to more than just the variant.h file. I'll do so tonight and report back. As far as clock configs go, I'll have some reading to do as well.

Thanks again.

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

Re: SensorTile

Post by oneselflost » Tue Oct 31, 2017 3:02 pm

So it looks like PA14 (SWD) will blink on the Sensortile with the L476RG variant, that's a plus! Woohoo!

I am still working on getting the other LED on PG12 to blink.

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

Re: SensorTile

Post by fpiSTM » Tue Oct 31, 2017 4:28 pm

Nice.
Do not hesitate to do a PR on the github.
I'm currently on vacation. I could help more next week.

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

Re: SensorTile

Post by oneselflost » Wed Nov 01, 2017 2:15 am

I'm at a point where I think the issue preventing PG12 from blinking might be a clock enable on GPIOG, as you mentioned prior - but I can't for the life of me find where this is enable is implemented. Where would I go about to make this happen?

Enjoy your vacation!

caniggia
Posts: 27
Joined: Tue Dec 06, 2016 2:38 pm

Re: SensorTile

Post by caniggia » Wed Nov 01, 2017 11:53 am

If you took NUCLEO_L476RG variant as template the GPIOG clock should be enabled.
As you can see in "Arduino_Core_STM32/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l476xx.h" you have:
#define GPIOG_BASE (AHB2PERIPH_BASE + 0x0000U)
and
#define GPIOG ((GPIO_TypeDef *) GPIOA_BASE)

In "stm32l4xx_hal_rcc.h" the "__HAL_RCC_GPIOG_CLK_ENABLE()" is defined:
https://github.com/stm32duino/Arduino_C ... rcc.h#L784

In "PortNames.c" the "__HAL_RCC_GPIOG_CLK_ENABLE()" is called:
https://github.com/stm32duino/Arduino_C ... mes.c#L136

Do you use blink example?
What error do you get?

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

Re: SensorTile

Post by oneselflost » Wed Nov 01, 2017 1:19 pm

Thank you so much for replying, and pointing me to those files.

Well if the GPIOG clock is already enabled, then I am at a loss for why this pin will not blink.

I am using the blink example, and it compiles and flashes without error.

Code: Select all

void setup() {
pinMode(PG12, OUTPUT); 
}

void loop(){
digitalWrite(PG12, HIGH);
delay(500); 
digitalWrite(PG12, LOW); 
delay(500);
}
I also defined LED2 to PG12.

From what I understand, I just needed to add PG12 to variant.h and PG_12 to variant.cpp, in the respective array, in the same position. I am modifying the NUCLEO_L476RG variant to get everything working before creating a new variant. Is there anything more I should be doing to add that pin, other than just those two additions?

Thanks again.

caniggia
Posts: 27
Joined: Tue Dec 06, 2016 2:38 pm

Re: SensorTile

Post by caniggia » Wed Nov 01, 2017 2:24 pm

What error do you get, when you compile/verify sketch ?
Or it compiles without error?

Post Reply