I'm working on a small private project where I want to use BLE to transfer data between my embedded system and a smartphone app. Below are some basic information before I start explaining my problem.
1. Which embOS do you use?
embOS_CortexM_GCC V506 with SES for ARM V4.42
2. Which CPU and eval board do you use?
EFR32MG12P433F1024GL125 CPU with EFR32MG12 starter kit
3. Which start project do you use?
Hello World project from EFR32MG12P sample projects
Problem:
I started by testing the eval kit with SiLabs Simplicity studio and the different example projects. First a singleloop project, then a pre-compiled project with SiLabs Micrium OS.
As I got an understanding of how it works, I tried to implement the singleloop version with SES and it worked almost directly. As soon as I got it running, I tried to modify the singleloop project to use embOS with all possibilities of using an RTOS.
The example project from Silabs (with Micrium OS) has several libraries which handles the BLE part and a wrapper (rtos_bluetooth.h, rtos_bluetooth.c) for the RTOS behaviour around the BLE libraries. As I understood, I just need to implement the
same wrapper for embOS and it should work. I started with creating a basic project which initializes the OS and the required hardware (I took some ideas from embOS sample projects for another SiLabs eval board) and got basic tasks running (measuring the
battery voltage every second and print it with RTT to RTT-Viewer). As I got the embOS running, I started with the implementation of the rtos_bluetooth wrapper. I copied the same structure that Micrium OS uses (the same tasks for BLE linklayer and BLE stack).
The configuration structure for SiLabs BLE library contains some flags (if using an RTOS or not), basic bluetooth settings (max_connections, BLE heap, BLE heap size, linklayer priorities, and so on). The config strucutre can be found in gecko_configuration.h
In addition when using an RTOS, the configuration structure also requires callback methods which are called from Interrupt context. This works at the beginning where I can initialize the bluetooth stack, setup the advertising parameters. As soon as I start advertising
my program runs into OS_ERROR with OS_ERR_CPU_STATE_ISR_ILLEGAL. As far as I understand, this means that I cannot call the OS_EVENT_SetMask function because my program is in an ISR with higher priority. I have no clue how I can resolve this issue.
I added my rtos_bluetooth wrapper files. The problem I'm facing happens after some time on Line 106 inside bluetoothLinkLayerCallback where I want to set the bitmask for my OS_EVENT.
Any help is appreciated.
I found in this link that I can use any RTOS I want if I modify the wrapper to use the new RTOS instead of Micrium:
silabs.com/community/wireless/…multiprotocol_withou-j6io
1. Which embOS do you use?
embOS_CortexM_GCC V506 with SES for ARM V4.42
2. Which CPU and eval board do you use?
EFR32MG12P433F1024GL125 CPU with EFR32MG12 starter kit
3. Which start project do you use?
Hello World project from EFR32MG12P sample projects
Problem:
I started by testing the eval kit with SiLabs Simplicity studio and the different example projects. First a singleloop project, then a pre-compiled project with SiLabs Micrium OS.
As I got an understanding of how it works, I tried to implement the singleloop version with SES and it worked almost directly. As soon as I got it running, I tried to modify the singleloop project to use embOS with all possibilities of using an RTOS.
The example project from Silabs (with Micrium OS) has several libraries which handles the BLE part and a wrapper (rtos_bluetooth.h, rtos_bluetooth.c) for the RTOS behaviour around the BLE libraries. As I understood, I just need to implement the
same wrapper for embOS and it should work. I started with creating a basic project which initializes the OS and the required hardware (I took some ideas from embOS sample projects for another SiLabs eval board) and got basic tasks running (measuring the
battery voltage every second and print it with RTT to RTT-Viewer). As I got the embOS running, I started with the implementation of the rtos_bluetooth wrapper. I copied the same structure that Micrium OS uses (the same tasks for BLE linklayer and BLE stack).
The configuration structure for SiLabs BLE library contains some flags (if using an RTOS or not), basic bluetooth settings (max_connections, BLE heap, BLE heap size, linklayer priorities, and so on). The config strucutre can be found in gecko_configuration.h
In addition when using an RTOS, the configuration structure also requires callback methods which are called from Interrupt context. This works at the beginning where I can initialize the bluetooth stack, setup the advertising parameters. As soon as I start advertising
my program runs into OS_ERROR with OS_ERR_CPU_STATE_ISR_ILLEGAL. As far as I understand, this means that I cannot call the OS_EVENT_SetMask function because my program is in an ISR with higher priority. I have no clue how I can resolve this issue.
I added my rtos_bluetooth wrapper files. The problem I'm facing happens after some time on Line 106 inside bluetoothLinkLayerCallback where I want to set the bitmask for my OS_EVENT.
Any help is appreciated.
I found in this link that I can use any RTOS I want if I modify the wrapper to use the new RTOS instead of Micrium:
silabs.com/community/wireless/…multiprotocol_withou-j6io