PAN1026 SDK without RTOS

Hi,

I want to create a SDK for PAN1026 without RTOS. This should be used for the microcontrollers with less memory.

Could you please guide me in the right direction?

6replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Are you looking forward to use both Bluetooth Classic and Bluetooth Low Energy?

    The Toshiba Bluetooth SDK for PAN1026 contains everything that is needed to make use of both the Bluetooth Classic and Bluetooth Low Energy features in a single application.

    It can be used on controllers with an operating system or in a microcontroller configuration without any operating system ("bare metal").

    Naturally the Bluetooth SDK consumes memory and processing power on the host processor.

    But in my opinion there is nothing you can do about it.

    Even if you start with a small re-implementation of the features that are used for one specific use-case. If you later add more code for other use-cases the re-implementation will grow in size until it reaches the implementation of the Bluetooth SDK. At that point nothing is gained any more.

     

    If you are looking for a significantly reduced memory consumption on the microcontroller and do not need Bluetooth Classic, then using a module like PAN1760A is the solution.

    It allows to run all Bluetooth processing directly on the module ("standalone mode") and the UART is used for custom communication between the microcontroller and the application running on the module.

    The trade off is that you need to develop a custom firmware for the PAN1760A, instead of working with your microcontroller alone.

    Reply Like
  • Thank you Michael for quick and detailed response.

    1. The Toshiba Bluetooth SDK for PAN1026 has all example projects with RTOS. The example projects are only using 1 task to perform its Bluetooth functionality. So we can definitely make a bare metal code out of it. But SDK also have a lot of code related to events. I believe these events would be generated by RTOS scheduler. I want to avoid all the code related to RTOS scheduler. I also read your response related to other PAN10126 posts. You have mentioned a document "software_manual_for_system_integration.pdf" to write a OS free code for Toshiba Bluetooth stack. Could you please share a link for this document?

    2. The SDK does not have any example code without OS. Although, it does have dummy projects which is without OS but I would be required to implement all the stub functions. I would really appreciate, If you can share an basic example code for PAN1026 without OS.

    3. As you mentioned, "It can be used on controllers with an operating system or in a microcontroller configuration without any operating system ("bare metal")."

    Could you please refer me a document to configure SDK for bare metal?

    I hope my understanding in point 1 is correct.

     

    Also, Could you please tell me the maximum memory usage by SDK with a bare simple application.

    1. with BT

    2. with BTE.

    3. with both feature enabled.

    Reply Like
  • But SDK also have a lot of code related to events. I believe these events would be generated by RTOS scheduler. I want to avoid all the code related to RTOS scheduler.

    The RTOS events and queues are used to transfer data or information from the interrupt handlers to the processing main loop.

    For example, the UART interrupt handler collects all bytes that are received and puts them into a receive queue for later processing.

    Handling the UART in the processing main loop is usually not feasible, because there is a high risk of losing data.

    Even when you run bare metal, you need some mechanism to forward data or information from interrupt handlers to the processing main loop, for example an interrupt-safe ringbuffer implementation.

    The Bluetooth SDK does not make any assumption how you handle this at all. Only the sample code is structured in such a way to make use of the RTOS features. You are free to do it differently.

    You have mentioned a document "software_manual_for_system_integration.pdf" to write a OS free code for Toshiba Bluetooth stack. Could you please share a link for this document?

    This document has been merged into the main documentation bluetooth_sdk_developers_guide_v3_4_1.pdf under chapter 7 Bluetooth Driver Integration & Porting

    Reply Like
  • The SDK does not have any example code without OS. Although, it does have dummy projects which is without OS but I would be required to implement all the stub functions. I would really appreciate, If you can share an basic example code for PAN1026 without OS

    The integration heavily depends on the platform, for example the host processor that is chosen. So it is basically impossible to provide a generic non-os sample project for PAN1026 that is actually working to some extend.

    As explained in chapter 7 Bluetooth Driver Integration & Porting the way to go is to include all necessary Bluetooth SDK files and all stub functions first, and then make the project compile & link again.

    Afterwards the data transmission / UART stub functions have to be implemented and the module initialisation can be done already.

    I have done this for both OS and non-OS platforms already and confirm that this approach is working.

    Reply Like
  • As you mentioned, "It can be used on controllers with an operating system or in a microcontroller configuration without any operating system ("bare metal")."

    Could you please refer me a document to configure SDK for bare metal?

    As explained in the previous post, the Bluetooth SDK does not rely on an OS. All porting is done via the porting layers which are provided as stub functions.

    The bluetooth_sdk_developers_guide_v3_4_1.pdf explains which files to use in a textual form, but it is easier to open one of the sample projects within IAR that fits your use-case and extract all the included C files from there.

    Also, Could you please tell me the maximum memory usage by SDK with a bare simple application.

    1. with BT

    2. with BTE.

    3. with both feature enabled.

    This heavily depends on the microcontroller you are using. For a standard Cortex-M3 microcontroller the Bluetooth SDK consumes about 25-35kB with both features enabled.

    You can reduce the memory usage for BT-only and BLE-only a little bit, but this needs time and effort.

    Reply Like
  • Michael Hunold 

    Hi Michael,

    Thank you for the quick response to the my last post.

    I am in process of porting Toshiba Bluetooth stack without RTOS for one of the Panasonic 8-bit controller with 64K ROM and 4K RAM. This controller does not support freeRTOS.

    Michael Hunold said:
    As explained in chapter 7 Bluetooth Driver Integration & Porting the way to go is to include all necessary Bluetooth SDK files and all stub functions first, and then make the project compile & link again.

     I am following chapter 7 for porting to new controller. However, I am facing issues like:

    1. For SPP communication, we need to implement stub function for unexpected events. As I am not using RTOS and heap memory being less, I cannot dynamically create buffer for storing unexpected events. I believe the maximum size for an unexpected events is appox. 500bytes. The demo example can support up to 16 unexpected events. So as a solution to this I thought of creating a static buffer for only 1 unexpected event of size 500bytes and support only 1 unexpected event.

      Could you please confirm if my understanding is correct and please suggest it this can be done in a better way?

    2. For timer start and stop stub functions, I am supposed to create timer Handler using RTOS and when this timer expires I am supposed to add the function associated with timer to a queue that will be called from the main function.

    Could you guide me a solution for this activity without using RTOS and dynamic memory allocation?

    Reply Like
reply to topic
Like Follow
  • Status Answered
  • 2 days agoLast active
  • 6Replies
  • 28Views
  • 2 Following