QuantumLeaps / qpcpp

QP/C++ Real-Time Embedded Framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
https://www.state-machine.com/products/qp
386 stars 82 forks source link

'struct k_msgq' has no member named 'maxMsg' (Zephyr port QSPY) #15

Closed vChavezB closed 2 years ago

vChavezB commented 2 years ago

I am trying to use QPCPP with Zephyr and want to implement QSPY. When using macro definition Q_SPY in my build I get the following error

qpcpp\ports\zephyr\qf_port.cpp:212:30: error: 'struct k_msgq' has no member named 'maxMsg'; did you mean 'max_msgs'?

I think the correct member variable should be max_msgs

See https://github.com/zephyrproject-rtos/zephyr/blob/main/include/zephyr/kernel.h#L4214

In addition I think nofmsgneeds to be replaced to used_msgs, see https://github.com/zephyrproject-rtos/zephyr/blob/main/include/zephyr/kernel.h#L4224

quantum-leaps commented 2 years ago

The reported issues in Zephyr port and examples in the Q_SPY build configuration have been fixed and pushed to the qpc and qpcpp repos. Please check.

Currently, the Q_SPY build configuration has not been tested, mostly because it was unclear how to implement the UART transmission (and reception as well). It would be great if somebody could contribute a working example for some board(s)...

vChavezB commented 2 years ago

Thanks for the information and update. Sorry I just realized I was not using the latest commit of qpcpp. I will test these new changes. I will probably add the uart implementation as I want to use qpcpp with zephyr. If everything works I will notify about this.