Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

xMessageBufferReceive return 0

Posted by sergiomartin on February 14, 2019

Hello,

I'm using Stream Buffers, in TASK A I'm receving data from UART and send this data to TASK B

TASK A:

~~~ do{ nb = UARTReceive(&serialrxbuf[oldpos], portMAXDELAY); if (nb > 0){ newpos = PARSERCOMPLETE(serialrxbuf, oldpos+nb); if (newpos != -1){ count++; countnb += nb; if ((nb+oldpos) - newpos > 0){ if (xMessageBufferSpaceAvailable(serialreceivedatabuffer) < (nb+oldpos) - newpos){ // TODO: NOTIFY RECEPTION BUFFER FULL fullbuffercount++; fullbuffernbcount += nb; }else{ xMessageBufferSend(serialreceivedatabuffer,serialrxbuf,(nb+oldpos) - newpos, 0 ); } if (newpos > 0){ memcpy(serialrxbuf,&PRtstserialrxbuf[nb+oldpos-newpos],newpos); } } oldpos = newpos; }else{ // TODO: NOTIFY LOST RECEPTION oldpos = 0; // Reset Reception lostreception_count++; } } }while(1); ~~~

TASK B:

~~~ do{ datalength = xMessageBufferReceive(serialreceivedatabuffer, data, MAXDATARECEIVE,portMAXDELAY); if (datalength>0){ PARSER(data, data_length); } }while(1); ~~~

Sometimes xMessageBufferReceive continuously return 0. Is it possible???

Best Regards,

Sergio


xMessageBufferReceive return 0

Posted by rtel on February 14, 2019

If I understand your question correctly, you are asking if it is possible for xMessageBufferReceive() to return 0 when portMAX_DELAY is used as the block time.

If that is the case then that could conceivable happen if something is sending your task a direct to task notification while it is blocked on the message buffer.

Does anything in your application use direct to task notifications, and if so, could such a notification be sent to the task that is blocked on the message buffer?


xMessageBufferReceive return 0

Posted by sergiomartin on February 15, 2019

Hi,

Yes this is my question. I donĀ“t know why xMessageBufferReceive() return 0 with portMAX_DELAY used as the block time., and once it receives it, it never becomes blocked again.

If something is sending to my task a direct to task notification, I'm not aware of that. How can it send "direct to task notifications"?

In my Code I use other StreamBuffers, but this is only used in the atach code.

Best Regards


xMessageBufferReceive return 0

Posted by sergiomartin on February 18, 2019

Hi,

Here more info:

serialreceivedata_buffer is in 0x20014898

Before first call to xMessageBufferSend 0x20014898: ~~~ 00000000 00000000 00001399 00000001 20016948 00000000 200148BC 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ...

~~~

After the First call to xMessageBufferSend 0x20014898: ~~~ 00000000 0000008D 00001399 00000001 00000000 00000000 200148BC 00000001 00000000 00000089 0083024E F0313101 D0008006 02010007 06050403 0A090807 0E0D0C0B 1211100F 16151413 1A191817 1E1D1C1B 2221201F 26252423 2A292827 2E2D2C2B 3231302F 36353433 3A393837 3E3D3C3B 4241403F 46454443 4A494847 4E4D4C4B 5251504F 56555453 5A595857 5E5D5C5B 6261605F 66656463 6A696867 6E6D6C6B 7271706F 76757473 63797877 00000064 00000000 00000000 00000000 ...

~~~

how can I interpret the first bytes of the structure? ~~~ 00000000 00000000 00001399 00000001 20016948 00000000 200148BC 00000001 00000000 00000000 ~~~ or ~~~ 00000000 0000008D 00001399 00000001 00000000 00000000 200148BC 00000001 00000000 00000089 ~~~

All Data insert to the StreamBuffer is like this: ~~~ 0012024E E5313101 D002AC0C 02010007 06050403 64330807

Header : 0x4E 0x02 Size : 0x00 0x12 ---> 18bytes (Fixed + Variable Data) Fixed Data : 0x01 0x31 0x31 0xE5 0x0C 0xAC 0x02 0xD0 0x07 Variable Data: 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 CRC : 0x33 0x64

~~~

The variable data is allways like this: ~~~ 0x00 0x01 ... 0xFE 0xFF 0x00 0x01... ~~~

If the Program in running for a Time calling xMessageBufferSend and xMessageBufferReceive on a certain moment the xMessageBufferReceive start to return 0 allways and then: 0x20014898: ~~~ 00000DE2 00000072 00001399 00000001 00000000 00000000 200148BC 00000001 00000000 BDBCBBBA C1C0BFBE C5C4C3C2 C9C8C7C6 CDCCCBCA D1D0CFCE D5D4D3D2 D9D8D7D6 DDDCDBDA E1E0DFDE E5E4E3E2 E9E8E7E6 EDECEBEA F1F0EFEE F5F4F3F2 F9F8F7F6 FDFCFBFA 0100FFFE 05040302 09080706 0D0C0B0A 11100F0E 15141312 19181716 1D1C1B1A 21201F1E 25242322 29282726 D1D04463 D5D4D3D2 D9D8D7D6 DDDCDBDA E1E0DFDE E5E4E3E2 E9E8E7E6 EDECEBEA F1F0EFEE F5F4F3F2 F9F8F7F6 FDFCFBFA 0100FFFE 05040302 09080706 0D0C0B0A 11100F0E 15141312 19181716 1D1C1B1A 21201F1E 25242322 29282726 2D2C2B2A 31302F2E 35343332 39383736 3D3C3B3A 41403F3E 45444342 49484746 4D4C4B4A 51504F4E 55545352 59585756 5D5C5B5A 61605F5E 65646362 69686766 6D6C6B6A 71706F6E 75747372 79787776 7D7C7B7A 81807F7E 85848382 89888786 8D8C8B8A 91908F8E 95949392 99989796 9D9C9B9A A1A09F9E A5A4A3A2 A9A8A7A6 ADACABAA B1B0AFAE B5B4B3B2 B9B8B7B6 BDBCBBBA C1C0BFBE C5C4C3C2 C9C8C7C6 CDCCCBCA D1D0CFCE D5D4D3D2 D9D8D7D6 DDDCDBDA E1E0DFDE E5E4E3E2 E9E8E7E6 EDECEBEA F1F0EFEE F5F4F3F2 912BDCF6 4E000004 01048B02 0CB43131 07D00488 03020100 07060504 0B0A0908 0F0E0D0C 13121110 17161514 1B1A1918 1F1E1D1C 23222120 27262524 2B2A2928 2F2E2D2C 33323130 37363534 3B3A3938 3F3E3D3C 43424140 47464544 4B4A4948 4F4E4D4C 53525150 57565554 5B5A5958 5F5E5D5C 63626160 67666564 6B6A6968 6F6E6D6C 73727170 77767574 7B7A7978 7F7E7D7C 83828180 87868584 8B8A8988 8F8E8D8C 93929190 97969594 9B9A9998 9F9E9D9C A3A2A1A0 A7A6A5A4 ABAAA9A8 AFAEADAC B3B2B1B0 B7B6B5B4 BBBAB9B8 BFBEBDBC C3C2C1C0 C7C6C5C4 CBCAC9C8 CFCECDCC D3D2D1D0 D7D6D5D4 DBDAD9D8 DFDEDDDC E3E2E1E0 E7E6E5E4 EBEAE9E8 EFEEEDEC F3F2F1F0 F7F6F5F4 FBFAF9F8 FFFEFDFC 03020100 07060504 0B0A0908 0F0E0D0C 13121110 17161514 1B1A1918 1F1E1D1C 23222120 27262524 2B2A2928 2F2E2D2C 33323130 37363534 3B3A3938 3F3E3D3C 43424140 47464544 4B4A4948 4F4E4D4C 53525150 57565554 5B5A5958 5F5E5D5C 63626160 67666564 6B6A6968 6F6E6D6C 73727170 77767574 7B7A7978 7F7E7D7C 83828180 87868584 8B8A8988 8F8E8D8C 93929190 97969594 9B9A9998 9F9E9D9C A3A2A1A0 A7A6A5A4 ABAAA9A8 AFAEADAC B3B2B1B0 B7B6B5B4 BBBAB9B8 BFBEBDBC C3C2C1C0 C7C6C5C4 CBCAC9C8 CFCECDCC D3D2D1D0 D7D6D5D4 DBDAD9D8 DFDEDDDC E3E2E1E0 E7E6E5E4 EBEAE9E8 EFEEEDEC F3F2F1F0 F7F6F5F4 FBFAF9F8 FFFEFDFC 03020100 07060504 0B0A0908 0F0E0D0C 13121110 17161514 1B1A1918 1F1E1D1C 23222120 27262524 2B2A2928 2F2E2D2C 33323130 37363534 3B3A3938 3F3E3D3C 43424140 47464544 4B4A4948 4F4E4D4C 53525150 57565554 5B5A5958 5F5E5D5C 63626160 67666564 6B6A6968 6F6E6D6C 73727170 77767574 7B7A7978 7F7E7D7C 83828180 87868584 8B8A8988 8F8E8D8C 93929190 97969594 9B9A9998 9F9E9D9C A3A2A1A0 A7A6A5A4 ABAAA9A8 AFAEADAC B3B2B1B0 B7B6B5B4 BBBAB9B8 BFBEBDBC C3C2C1C0 C7C6C5C4 CBCAC9C8 CFCECDCC D3D2D1D0 D7D6D5D4 DBDAD9D8 DFDEDDDC E3E2E1E0 E7E6E5E4 EBEAE9E8 EFEEEDEC F3F2F1F0 F7F6F5F4 FBFAF9F8 FFFEFDFC 03020100 07060504 0B0A0908 0F0E0D0C 13121110 17161514 1B1A1918 1F1E1D1C 23222120 27262524 2B2A2928 2F2E2D2C 33323130 37363534 3B3A3938 3F3E3D3C 43424140 47464544 4B4A4948 4F4E4D4C 53525150 57565554 5B5A5958 5F5E5D5C 63626160 67666564 6B6A6968 6F6E6D6C 73727170 77767574 7B7A7978 7F7E7D7C 83828180 87868584 8B8A8988 8F8E8D8C 93929190 97969594 9B9A9998 9F9E9D9C A3A2A1A0 A7A6A5A4 ABAAA9A8 AFAEADAC B3B2B1B0 B7B6B5B4 BBBAB9B8 BFBEBDBC C3C2C1C0 C7C6C5C4 CBCAC9C8 CFCECDCC D3D2D1D0 D7D6D5D4 DBDAD9D8 DFDEDDDC E3E2E1E0 E7E6E5E4 EBEAE9E8 EFEEEDEC F3F2F1F0 F7F6F5F4 FBFAF9F8 FFFEFDFC 03020100 07060504 0B0A0908 0F0E0D0C 13121110 17161514 1B1A1918 1F1E1D1C 23222120 27262524 2B2A2928 2F2E2D2C 33323130 37363534 3B3A3938 3F3E3D3C 43424140 47464544 4B4A4948 4F4E4D4C 53525150 57565554 5B5A5958 5F5E5D5C 63626160 67666564 6B6A6968 6F6E6D6C 73727170 77767574 7B7A7978 7F7E7D7C 21C88180 000002E1 02DB024E B5313101 D002D80C 02010007 06050403 0A090807 0E0D0C0B 1211100F 16151413 1A191817 1E1D1C1B 2221201F 26252423 2A292827 2E2D2C2B 3231302F 36353433 3A393837 3E3D3C3B 4241403F 46454443 4A494847 4E4D4C4B 5251504F 56555453 5A595857 5E5D5C5B 6261605F 66656463 6A696867 6E6D6C6B 7271706F 76757473 7A797877 7E7D7C7B 8281807F 86858483 8A898887 8E8D8C8B 9291908F 96959493 9A999897 9E9D9C9B A2A1A09F A6A5A4A3 AAA9A8A7 AEADACAB B2B1B0AF B6B5B4B3 BAB9B8B7 BEBDBCBB C2C1C0BF C6C5C4C3 CAC9C8C7 CECDCCCB D2D1D0CF D6D5D4D3 DAD9D8D7 DEDDDCDB E2E1E0DF E6E5E4E3 EAE9E8E7 EEEDECEB F2F1F0EF F6F5F4F3 FAF9F8F7 FEFDFCFB 020100FF 06050403 0A090807 0E0D0C0B 1211100F 16151413 1A191817 1E1D1C1B 2221201F 26252423 2A292827 2E2D2C2B 3231302F 36353433 3A393837 3E3D3C3B 4241403F 46454443 4A494847 4E4D4C4B 5251504F 56555453 5A595857 5E5D5C5B 6261605F 66656463 6A696867 6E6D6C6B 7271706F 76757473 7A797877 7E7D7C7B 8281807F 86858483 8A898887 8E8D8C8B 9291908F 96959493 9A999897 9E9D9C9B A2A1A09F A6A5A4A3 AAA9A8A7 AEADACAB B2B1B0AF B6B5B4B3 BAB9B8B7 BEBDBCBB C2C1C0BF C6C5C4C3 CAC9C8C7 CECDCCCB D2D1D0CF D6D5D4D3 DAD9D8D7 DEDDDCDB E2E1E0DF E6E5E4E3 EAE9E8E7 EEEDECEB F2F1F0EF F6F5F4F3 FAF9F8F7 FEFDFCFB 020100FF 06050403 0A090807 0E0D0C0B 1211100F 16151413 1A191817 1E1D1C1B 2221201F 26252423 2A292827 2E2D2C2B 3231302F 36353433 3A393837 3E3D3C3B 4241403F 46454443 4A494847 4E4D4C4B 5251504F 56555453 5A595857 5E5D5C5B 6261605F 66656463 6A696867 6E6D6C6B 7271706F 76757473 7A797877 7E7D7C7B 8281807F 86858483 8A898887 8E8D8C8B 9291908F 96959493 9A999897 9E9D9C9B A2A1A09F A6A5A4A3 AAA9A8A7 AEADACAB B2B1B0AF B6B5B4B3 BAB9B8B7 BEBDBCBB C2C1C0BF C6C5C4C3 CAC9C8C7 CECDCCCB 75D1D0CF 00008773 81024E00 31310100 007E0CB6 010007D0 05040302 09080706 0D0C0B0A 11100F0E 15141312 19181716 1D1C1B1A 21201F1E 25242322 29282726 2D2C2B2A 31302F2E 35343332 39383736 3D3C3B3A 41403F3E 45444342 49484746 4D4C4B4A 51504F4E 55545352 59585756 5D5C5B5A 61605F5E 65646362 69686766 6D6C6B6A 71706F6E 75747372 44577776 00000091 008B024E B7313101 D000880C 02010007 06050403 0A090807 0E0D0C0B 1211100F 16151413 1A191817 1E1D1C1B 2221201F 26252423 2A292827 2E2D2C2B 3231302F 36353433 3A393837 3E3D3C3B 4241403F 46454443 4A494847 4E4D4C4B 5251504F 56555453 5A595857 5E5D5C5B 6261605F 66656463 6A696867 6E6D6C6B 7271706F 76757473 7A797877 7E7D7C7B 7681807F 0003A9F3 A3024E00 31310103 03A00CB8 010007D0 05040302 09080706 0D0C0B0A 11100F0E 15141312 19181716 1D1C1B1A 21201F1E 25242322 29282726 2D2C2B2A 31302F2E 35343332 39383736 3D3C3B3A 41403F3E 45444342 49484746 4D4C4B4A 51504F4E 55545352 59585756 5D5C5B5A 61605F5E 65646362 69686766 6D6C6B6A 71706F6E 75747372 79787776 7D7C7B7A 81807F7E 85848382 89888786 8D8C8B8A 91908F8E 95949392 99989796 9D9C9B9A A1A09F9E A5A4A3A2 A9A8A7A6 ADACABAA B1B0AFAE B5B4B3B2 B9B8B7B6 BDBCBBBA C1C0BFBE C5C4C3C2 C9C8C7C6 CDCCCBCA D1D0CFCE D5D4D3D2 D9D8D7D6 DDDCDBDA E1E0DFDE E5E4E3E2 E9E8E7E6 EDECEBEA F1F0EFEE F5F4F3F2 F9F8F7F6 FDFCFBFA 0100FFFE 05040302 09080706 0D0C0B0A 11100F0E 15141312 19181716 1D1C1B1A 21201F1E 25242322 29282726 2D2C2B2A 31302F2E 35343332 39383736 3D3C3B3A 41403F3E 45444342 49484746 4D4C4B4A 51504F4E 55545352 59585756 5D5C5B5A 61605F5E 65646362 69686766 6D6C6B6A 71706F6E 75747372 79787776 7D7C7B7A 81807F7E 85848382 89888786 8D8C8B8A 91908F8E 95949392 99989796 9D9C9B9A A1A09F9E A5A4A3A2 A9A8A7A6 ADACABAA B1B0AFAE B5B4B3B2 B9B8B7B6 BDBCBBBA C1C0BFBE C5C4C3C2 C9C8C7C6 CDCCCBCA D1D0CFCE D5D4D3D2 D9D8D7D6 DDDCDBDA E1E0DFDE E5E4E3E2 E9E8E7E6 EDECEBEA F1F0EFEE F5F4F3F2 F9F8F7F6 FDFCFBFA 0100FFFE 05040302 09080706 0D0C0B0A 11100F0E 15141312 19181716 1D1C1B1A 21201F1E 25242322 29282726 2D2C2B2A 31302F2E 35343332 39383736 3D3C3B3A 41403F3E 45444342 49484746 4D4C4B4A 51504F4E 55545352 59585756 5D5C5B5A 61605F5E 65646362 69686766 6D6C6B6A 71706F6E 75747372 79787776 7D7C7B7A 81807F7E 85848382 89888786 8D8C8B8A 91908F8E 95949392 99989796 9D9C9B9A A1A09F9E A5A4A3A2 A9A8A7A6 ADACABAA B1B0AFAE B5B4B3B2 B9B8B7B6 BDBCBBBA C1C0BFBE C5C4C3C2 C9C8C7C6 CDCCCBCA D1D0CFCE D5D4D3D2 D9D8D7D6 DDDCDBDA E1E0DFDE E5E4E3E2 E9E8E7E6 EDECEBEA F1F0EFEE F5F4F3F2 F9F8F7F6 FDFCFBFA 0100FFFE 05040302 09080706 0D0C0B0A 11100F0E 15141312 19181716 1D1C1B1A 21201F1E 25242322 29282726 2D2C2B2A 31302F2E 35343332 39383736 3D3C3B3A 41403F3E 45444342 49484746 4D4C4B4A 51504F4E 55545352 59585756 5D5C5B5A 61605F5E 65646362 69686766 6D6C6B6A 71706F6E 75747372 79787776 7D7C7B7A 81807F7E 85848382 89888786 8D8C8B8A 91908F8E 95949392 99989796 0625F902 024E0000 310103E6 E30CB931 0007D003 04030201 08070605 0C0B0A09 100F0E0D 14131211 18171615 1C1B1A19 201F1E1D 24232221 28272625 2C2B2A29 302F2E2D 34333231 38373635 3C3B3A39 403F3E3D 44434241 48474645 4C4B4A49 504F4E4D 54535251 58575655 5C5B5A59 605F5E5D 64636261 68676665 6C6B6A69 706F6E6D 74737271 78777675 7C7B7A79 807F7E7D 84838281 88878685 8C8B8A89 908F8E8D 94939291 98979695 9C9B9A99 A09F9E9D A4A3A2A1 A8A7A6A5 ACABAAA9 B0AFAEAD B4B3B2B1 B8B7B6B5 BCBBBAB9 C0BFBEBD C4C3C2C1 C8C7C6C5 CCCBCAC9 D0CFCECD D4D3D2D1 D8D7D6D5 DCDBDAD9 E0DFDEDD E4E3E2E1 E8E7E6E5 ECEBEAE9 F0EFEEED F4F3F2F1 F8F7F6F5 FCFBFAF9 00FFFEFD 04030201 08070605 0C0B0A09 100F0E0D 14131211 18171615 1C1B1A19 201F1E1D 24232221 28272625 2C2B2A29 302F2E2D 34333231 38373635 3C3B3A39 403F3E3D 44434241 48474645 4C4B4A49 504F4E4D 54535251 58575655 5C5B5A59 605F5E5D 64636261 68676665 6C6B6A69 706F6E6D 74737271 78777675 7C7B7A79 807F7E7D 84838281 88878685 8C8B8A89 908F8E8D 94939291 98979695 9C9B9A99 A09F9E9D A4A3A2A1 A8A7A6A5 ACABAAA9 B0AFAEAD B4B3B2B1 B8B7B6B5 BCBBBAB9 C0BFBEBD C4C3C2C1 C8C7C6C5 CCCBCAC9 D0CFCECD D4D3D2D1 D8D7D6D5 DCDBDAD9 E0DFDEDD E4E3E2E1 E8E7E6E5 ECEBEAE9 F0EFEEED F4F3F2F1 F8F7F6F5 FCFBFAF9 00FFFEFD 04030201 08070605 0C0B0A09 100F0E0D 14131211 18171615 1C1B1A19 201F1E1D 24232221 28272625 2C2B2A29 302F2E2D 34333231 38373635 3C3B3A39 403F3E3D 44434241 48474645 4C4B4A49 504F4E4D 54535251 58575655 5C5B5A59 605F5E5D 64636261 68676665 6C6B6A69 706F6E6D 74737271 78777675 7C7B7A79 807F7E7D 84838281 88878685 8C8B8A89 908F8E8D 94939291 98979695 9C9B9A99 A09F9E9D A4A3A2A1 A8A7A6A5 ACABAAA9 B0AFAEAD B4B3B2B1 B8B7B6B5 BCBBBAB9 C0BFBEBD C4C3C2C1 C8C7C6C5 CCCBCAC9 D0CFCECD D4D3D2D1 D8D7D6D5 DCDBDAD9 E0DFDEDD E4E3E2E1 E8E7E6E5 ECEBEAE9 F0EFEEED F4F3F2F1 F8F7F6F5 FCFBFAF9 00FFFEFD 04030201 08070605 0C0B0A09 100F0E0D 14131211 18171615 1C1B1A19 201F1E1D 24232221 28272625 2C2B2A29 302F2E2D 34333231 38373635 3C3B3A39 403F3E3D 44434241 48474645 4C4B4A49 504F4E4D 54535251 58575655 5C5B5A59 605F5E5D 64636261 68676665 6C6B6A69 706F6E6D 74737271 78777675 7C7B7A79 807F7E7D 84838281 88878685 8C8B8A89 908F8E8D 94939291 98979695 9C9B9A99 A09F9E9D A4A3A2A1 A8A7A6A5 ACABAAA9 B0AFAEAD B4B3B2B1 B8B7B6B5 BCBBBAB9 C0BFBEBD C4C3C2C1 C8C7C6C5 CCCBCAC9 D0CFCECD D4D3D2D1 D8D7D6D5 DCDBDAD9 024E1DE4 31010233 300CBA31 0007D002 04030201 08070605 0C0B0A09 100F0E0D 14131211 18171615 1C1B1A19 201F1E1D 24232221 28272625 2C2B2A29 302F2E2D 34333231 38373635 3C3B3A39 403F3E3D 44434241 48474645 4C4B4A49 504F4E4D 54535251 58575655 5C5B5A59 605F5E5D 64636261 68676665 6C6B6A69 706F6E6D 74737271 78777675 7C7B7A79 807F7E7D 84838281 88878685 8C8B8A89 908F8E8D 94939291 98979695 9C9B9A99 A09F9E9D A4A3A2A1 A8A7A6A5 ACABAAA9 B0AFAEAD B4B3B2B1 B8B7B6B5 BCBBBAB9 C0BFBEBD C4C3C2C1 C8C7C6C5 CCCBCAC9 D0CFCECD D4D3D2D1 D8D7D6D5 DCDBDAD9 E0DFDEDD E4E3E2E1 E8E7E6E5 ECEBEAE9 F0EFEEED F4F3F2F1 F8F7F6F5 FCFBFAF9 00FFFEFD 04030201 08070605 0C0B0A09 100F0E0D 14131211 18171615 1C1B1A19 201F1E1D 24232221 28272625 2C2B2A29 302F2E2D 34333231 38373635 3C3B3A39 403F3E3D 44434241 48474645 4C4B4A49 504F4E4D 54535251 58575655 5C5B5A59 605F5E5D 64636261 68676665 6C6B6A69 706F6E6D 74737271 78777675 7C7B7A79 807F7E7D 84838281 88878685 8C8B8A89 908F8E8D 94939291 98979695 9C9B9A99 A09F9E9D A4A3A2A1 A8A7A6A5 ACABAAA9 B0AFAEAD B4B3B2B1 B8B7B6B5 000000B9 20017CB4 00000308 A5A5A5A5 A5A5A5A5 A5A5A5A5 A5A5A5A5 A5A5A5A5 A5A5A5A5 A5A5A5A5 A5A5A5A5 A5A5A5A5 ... ~~~

This gives you some clue?

Best Regards,

Sergio


xMessageBufferReceive return 0

Posted by rtel on February 18, 2019

Sorry - don't know what I am looking at in your last post.


xMessageBufferReceive return 0

Posted by sergiomartin on February 18, 2019

Hi,

I have only included more information about the Stream Buffer in case some of the internal information had been corrupted, since I do not know how to interpret the first bytes of StreamBuffer structure.

If when I detect the problem (return 0):

  • I check if there is space available in the buffer [xMessageBufferSpaceAvailable] I see that if there is space, and the buffer is not empty ... but it keeps returning 0.
  • I do a xMessageBufferReset everything works again until it happens again.

Best Regards

Sergio


xMessageBufferReceive return 0

Posted by rtel on February 18, 2019

Have you stepped through the call in the debugger to see why it is returning 0?


xMessageBufferReceive return 0

Posted by sergiomartin on February 19, 2019

Hi,

My Mistake... the Size of Frame inserted with xMessageBufferSend was greater than xBufferLengthBytes Parameter in xMessageBufferReceive

Thanks,

Sergio


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Mediatek

Renesas

RISC-V

SiFIve RISC-V

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner