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...
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...
Hi Manu From your screenshot it is evident that your mempool is corrupted: Mempool is defined by the its start and end pointers in memory. In you case: start: 0x20000A5C end: 0x20000CB0 And your next free block pointer (free_head) must point to somewhere in the mempool, which it isn’t. free_head: 0x010100B3 Either something is writing past the end of an allocated mempool item or something else is corrupting your mempool object itself. Do you see any assertions firing? This should catch free_head...
Have a look at "7.9 Native QF Memory Pool" in Miro's book - Practical UML Statecharts in C/C++ - which you can download from his website. The code has changed a bit since the book was written, but the overall concepts are stil the same.
Hi Manu You are definately experiencing some memory corrupting. Stack overflow is the first thing to check, but if that is not the culprit, I can share some previous experiences that might help. I have encounter similar hardfaults with Q_NEW()->QMPool_get() in the past. Note that the first 4 bytes of an unused item in a mempool is a pointer to a free item in that mempool (linked list). Almost all of my issues were due to writing beyond the edge of a previous allocated mempool item and the corrupting...
Hi Miro Any plans for a Nordic nRF52 M4 port in the future? Thanks in advance, Gawie
Hi Miro I know it is always difficult to make estimations for new features, but can...
Hi Timothy I would like suggest the following pseudo code that worked for me in the...
Hi Timothy I would like suggest the following pseudo code that worked for me in the...
Hi Liviu Thank you very much for your time - a fresh Eclipse install did the trick....
Hi Liviu I double checked everything as you suggested - still no luck. In the mean...
Hi Liviu I double checked everything as you suggested - still no luck. In the mean...
Ok, lets first look at the path issue. I have two instances where the PATH variable...
PATH: /usr/local/gcc-arm-none-eabi-4_9-2014q4/bin:/usr/bin:/bin:/usr/sbin:/sbin jlink_path...
Ok, I am using the latest beta from updates-test - GNU ARM C/C++ Cross Compiler 1.13.1.201503091711....
Hi Liviu Seems that something is wrong with my PATH. I enabled the switch to allocate...
are you using managed projects? or makefile projects? I am not using makefiles, so...
J-Link Plugin - some debugging issues
Hi Miro I have added the assert as you suggested and it caught its first bug yesterday....
Hi Miro We have been using QP for the last 5 years with great success. Thanks for...