Hi Giulio I have implemented similar lwIP requirements by implementing the orthogonal pattern with great success. Where the "main" HSM handles all the TCP/IP stack connection related functionality and only once connected with IP address, then the other orthogonal HSM's comes into play - handling higher layer protocols. Basically your option 2. Cheers, Gawie
Hi Jakub I assume that your messages follow a predifined protocol which have some kind of checksum to validate incoming messages. You also might have some message ids that you want ignore. I assume that these are the kind of post processing that you want to do. I suggest that you do the post processing in your ISR while packing data in a dynamic created event. You should only handle one message at a time and not trying to allocate many events up front. Your messgaes might/should have a length paramater...
I guess that your intention was to create a new event for every character received. You should move Q_NEW_FROM_ISR()into your while loop to achieve that. Otherwise you are just overwriting character->temp of the same event while sitting in the loop.
I guess that your intention was to create a new event for every character received. You should move Q_NEW_FROM_ISR()into your while loop to achieve that. Otherwise you are just overriding character->temp of the same event while sitting in the loop.
Why can this not work: typedef struct OrthogonalEvt_s { QEvt super; QHsm* owner; } OrthogonalEvt;
Hi Manu What I am trying to say is that your mempool corruption is happening in the pool with block size = 4. CLIUARTDriverEvt requires at least 14 bytes and events of this type will be allocated from another pool. You don't have to specify the event pool when allocating an event, QPC will automatically select the correct pool by using the size of the event. May be I am not understanding you correctly, but it seems like you are ignoring some asserts - you should break for all assertions while debugging....
Hi Manu Regarding your question about assigning a 32bit value to a 16bit variable - the value will be truncated to 16bits. Your compiler should warn you about it. The event pool that you previously referred to in your screenshots, had a blocksize of 4 (l_smlPoolSto) - which can only be used for events with no data part. Your UARTDriverEvt has a size of 14, so either you are allocating events wrongly or this event is allocated from a different pool. If it is the latter, then you are barking at the...
Hi Manu Great, you ASSERT is firing. BTW, you should never develop (or even release) with ASSERTs disabled! Your mempool is already corrupted when your SPI callback is calling Q_NEW(). The ASSERT is just telling you that fbnext was just assigned a value that is not pointing to memory in the allocated space for your mempool. The mempool wasn’t corrupted by anything related when the ASSERT fired, it was corrupted by some previous operation - can be totally unrelated, depends of what other events were...