BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: Modifying ESD project to work in low power environment with RTOS  (Read 7571 times)

Louis Cloete

  • Newbie
  • *
  • Posts: 6
    • View Profile
Modifying ESD project to work in low power environment with RTOS
« on: November 16, 2022, 11:23:56 AM »

Hi everybody

I'm trying to use a BT816 chip with ESD in a project. The device will be battery powered, so enabling the processor to go to low power modes would be very useful. Unfortunately, it seems like the ESD output is not written with that in mind: http://www.brtcommunity.com/index.php?topic=394.

In this thread a user alluded to the possibility of modifying the generated output to work with RTOS event loop. Did anybody do that? Is there an example I can follow?

What I have tried

I have got both the EvChargePoint demo and the TIM2 interrupt clock running on a Nucleo-STM32L476RG. I do understand the porting process. I'm getting stuck at how to enable the screen task communicate with my button handler, monitoring thread (temperature, voltages, current, charger status) and communications handler.

What I need to do

I need to update the screen when buttons are pushed, when the temperature/voltage/current/charge changes state and when I receive messages. Animations are not out of the question. I do not need any touch screen functionality for now. The product will be used in a -20C freezer room, so it has a perspex plate over the screen and is in an IP67 enclosure. Touch isn't viable/practical.

What is my best option? I have looked at ESE as well, but the widgets from ESD just look easier to get to look good.
« Last Edit: November 16, 2022, 11:26:07 AM by Louis Cloete »
Logged

Cyrilou

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Modifying ESD project to work in low power environment with RTOS
« Reply #1 on: November 18, 2022, 02:39:33 PM »

Hi,

You must use update callback of esd to send orders to the screen.
You can use queues or semaphores to get data in this callback.
To simulate on ESD your GUI you can add buttons connected to slots.
Logged

Domdom

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Modifying ESD project to work in low power environment with RTOS
« Reply #2 on: November 21, 2022, 04:30:25 AM »

Hi Louis Cloete,

As you do not need any touch screen functionality, I guess you want to update screen with sensor data, am I right?

You can use a global variable on ESD and connect it with the widget you want, example: A numeric label. Here is how to do it on ESD:

1. in Usr_Source_Files.c, declare the variable name (image 1.JPG)


2. In the page, connect the variable to a widget (image 2.JPG)


Export the project and you can extern that variable in your code.
« Last Edit: November 21, 2022, 10:07:03 AM by Domdom »
Logged

pauljiao

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Modifying ESD project to work in low power environment with RTOS
« Reply #3 on: November 23, 2022, 10:33:15 AM »

You can open the App.main in the node editor and double click the output rectangle of update slot, which creates the update signal handler.   The handler is defined in app.c and  repeatedly called by framework.   Within the app.c, you can declare one global variable which can be used by any pages of the current ESD project. Therefore, the widgets can be connected with the defined global variable so that UI gets updated.   In the handler,  the global variable is updated/written by your monitoring thread.

Logged

Louis Cloete

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Modifying ESD project to work in low power environment with RTOS
« Reply #4 on: December 02, 2022, 01:33:05 PM »

Thanks for the answers. I've been working on other projects for a while, but I'm getting back to this again.

This clarifies matters a bit. I think I'll be able to get this working now.

@Domdom I'm getting RF packets from industrial machines as one data source. That will be pre-processed by the microcontroller and result in "sensor-like" readings in some cases. I also have physical "soft button" membrane switches around the edges of the screen. The reason we don't use touch is because it might be unreliable and prone to failure in a factory environment.
Logged