question

DominikJadczak-6526 avatar image
0 Votes"
DominikJadczak-6526 asked BoChen-0401 answered

SysTick problem in Stm32 with AzureRTOS

I am trying to implement an example of sending data from B-L4S5I-IOT01A board sensors to Azure IoT Central via telemetry to Stm32CubeIDE and I almost succeeded but I have a problem with Systick because there are no interrupts from Systick in the Wifi initialization function. I tried to change the Systick to a different timer like TIM6 but that only made things worse. I tried to add Wifi initialization before AzureRTOS initialization and in tx_thread_entry but I also have the same problem. Anyone else have any ideas or would like to debug the code?

Link to the example from which I am copying: https://github.com/azure-rtos/getting-started/tree/master/STMicroelectronics/B-L4S5I-IOT01A


Link to my not working project: https://github.com/jadczakoff/Azure_IoT_Problem_Systick

azure-rtos
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@DominikJadczak-6526 Wanted to follow up with you to understand whether the below information helped. Please let us know if there are any other queries.
If below suggestions answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

0 Votes 0 ·

@AshokPeddakotla-MSFT
Answers were being almost good enough but if anybody know how to rewrite my code in way which i can get some charts in AzureIoTCentral because its pretty tough for me. I was trying rewrite but i don't understand how json writer works so please give me advice to my code what i should to change

My code: https://github.com/jadczakoff/Azure_IoT_Project/blob/main/Core/Src/sample_azure_iot_embedded_sdk_pnp.c

Example code with some charts: https://github.com/azure-rtos/getting-started/blob/master/STMicroelectronics/B-L4S5I-IOT01A/app/nx_client.c

0 Votes 0 ·
WenWang-8834 avatar image
0 Votes"
WenWang-8834 answered DominikJadczak-6526 commented

Hi,

it seems that the "HAL_InitTick" is not setup successfully.
please take the file here as a reference how to redefine "HAL_InitTick" :

https://github.com/azure-rtos/getting-started/blob/master/STMicroelectronics/B-L4S5I-IOT01A/lib/stm32cubel4/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_timebase_tim_template.c

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@WenWang-8834
Okey so i fully redefine it but i still have this problem look at screen below
188234-image.png


188274-image.png


0 Votes 0 ·
image.png (119.9 KiB)
image.png (117.9 KiB)

I guess you are stuck before calling tx_kernel_enter(), right?
if so , tx_time_get() is not working at this stage. it is better to keep HAL_GetTick() like this :
https://github.com/azure-rtos/getting-started/blob/master/STMicroelectronics/B-L4S5I-IOT01A/lib/stm32cubel4/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c
because there are hardware initializations before entering kernel, and HAL_GetTick() will be used in delay function for hardware initialization .

0 Votes 0 ·

@WenWang-8834
I'm stuck here but i tried very different combinations sometimes put wifi_init before tx_kernel_enter(), somtimes after but result is the same
188305-image.png


0 Votes 0 ·
image.png (75.0 KiB)

@WenWang-8834

Okey so i fix it and now its working but i have problem with add extra charts with datas from different sensors because a little bit don't understand code. If you have some time to explain couple of things how to add extra chart, i will be thankful


link to my project: https://github.com/jadczakoff/Azure_IoT_Project

0 Votes 0 ·
WenWang-8834 avatar image WenWang-8834 DominikJadczak-6526 ·

here are examples of how to add sensor types like : hts221,lis2mdl,lps22hb,lsm6ds.

https://github.com/azure-rtos/getting-started/tree/master/MXChip/AZ3166/app
Hope it will be helpful.

0 Votes 0 ·
DominikJadczak-6526 avatar image
0 Votes"
DominikJadczak-6526 answered

@WenWang-8834
I can't find this file nx_azure_iot_pnp_helpers.h
Do you have any idea where is it?

Link: https://docs.microsoft.com/en-us/azure/iot-develop/concepts-developer-guide-device?pivots=programming-language-embedded-c

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BoChen-0401 avatar image
0 Votes"
BoChen-0401 answered

Hi @DominikJadczak-6526, looks the user guide you linked is out of date, we will update it. PnP feature is already integrated into IoT Hub, we do not need pnp helper functions, you can refer to following samples for PnP.

Sample IoT Plug and Play Thermostat
Sample IoT Plug and Play Temperature Controller


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.