This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sample code to send "Hello World" from one task to another FreeRTOS

Hi, Could you send me a sample to send "Hello World!" string from sender task to receiver task?

I am using C:\Nordic_Semi\nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_hrs_freertos\pca10056\s140\ses as a base project.

I can create two tasks correctly say senderTask and receiverTask. Now, I have difficult to create a message box and send/receive message.

I am using Embedded Studio & 64bits Window10.

Please help,Thanks,

donald

 

Parents Reply
  • Can you compile FreeRTOS sample code:

    void vAFunction( MessageBuffer_t xMessageBuffer )
    {
    uint8_t ucRxData[ 20 ];
    size_t xReceivedBytes;
    const TickType_t xBlockTime = pdMS_TO_TICKS( 20 );
    
        /* Receive the next message from the message buffer.  Wait in the Blocked
        state (so not using any CPU processing time) for a maximum of 100ms for
        a message to become available. */
        xReceivedBytes = xMessageBufferReceive( xMessageBuffer,
                                                ( void * ) ucRxData,
                                                sizeof( ucRxData ),
                                                xBlockTime );
    
        if( xReceivedBytes > 0 )
        {
            /* A ucRxData contains a message that is xReceivedBytes long.  Process
            the message here.... */
        }
    }
    
Children
No Data
Related