GithubHelp home page GithubHelp logo

quantumleaps / qp-arduino Goto Github PK

View Code? Open in Web Editor NEW
42.0 12.0 28.0 1.91 MB

QP real-time embedded frameworks/RTOS for Arduino (AVR and SAM)

Home Page: https://www.state-machine.com/arduino

License: GNU General Public License v3.0

C++ 82.67% C 15.77% Roff 0.01% Python 1.52% Batchfile 0.03%
arduino arduino-library rtos event-driven kernel state-machine fsm framework free samek

qp-arduino's Issues

Compatibility with the Arduino library registry ?

The current installation of the library is done by cloning this repository and selecting the version you want to use (arm or avr) and copying it to the Arduino Library path.

Officially Arduino has a registry repository where any library can be added and made accessible via the Arduino library manager.

https://github.com/arduino/library-registry

Why hasn't it been thought to use the official Arduino method?

Teensy resets when using QF::poolInit without prior call of QS_INIT

Hello!

We've used qp-arduino for quite a while now on Teensy 4.0 and Teensy 4.1.
As the project becomes more and more involved I wanted to update to the latest version to incorporate QSPY and (proper) UnitTesting.

Adapting the Teensy-example provided with this release was easy enough to get the expected Q-SPY output. But a few issues and questions remain:

  • Why are QS::onCleanup(), QS::onGetTime(), QS::onFlush() and QS::onReset() needed, even when Q-Spy is disabled (QS_ON not defined). This seems to be inconsistent with QS::onStartup() and QS::onCommand(), which do not necessarily have to be implemented. This is not a problem, just a question, though.

  • When QF::poolInit(...) is called before QS::onStartup() runs, Teensy resets itself. So far I've tracked it down to these BSP-calls in QS::onStartup(void const * arg):

static uint8_t qsTxBuf[1024]; // buffer for QS transmit channel (QS-TX)
static uint8_t qsRxBuf[128];  // buffer for QS receive channel (QS-RX)
initBuf  (qsTxBuf, sizeof(qsTxBuf));
rxInitBuf(qsRxBuf, sizeof(qsRxBuf));

If initBuf and rxInitBuf are not called before initializing the event pool (QF::poolInit(...)) the MCU resets. This means, that without QS_ON no event pool can currently be used, as this surpresses the call to QS::onStartup().

To reproduce, add these lines to the Teensy setup() method after BSP::init();:

DMAMEM static QF_MPOOL_EL(uint64_t) BigPoolSto[50];
QF::poolInit(BigPoolSto, sizeof(BigPoolSto), sizeof(BigPoolSto[0]));

As long as QS_ON is defined, the code should run fine. However, if QS_ON is not defined, the MCU should crash and reset itself.

Here is the code I used to test and reproduce the problem. If you extract it into /libraries/qpcpp_arm-cm/examples/blinky-qspy-teensy4/ it should be directly executable with PlatformIO.
teensy.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.