Hi to you all,In my current project I need to send over a serial bus an array of integers:
The driver I'm using (actually USB CDC VCOM from NXP, which is embedded in LPCOpen) takes pointer to unit8 and does a bulk transfer using DMA. I can output long strings, no problem. But of course I need to output data and so 32 bit integers.
Here's the function I'm trying to call:
/** \fn uint32_t WriteEP(USBD_HANDLE_T hUsb, uint32_t EPNum, uint8_t *pData, uint32_t cnt) * Function to write data to be sent on the requested endpoint. * * This function is called by USB stack and the application layer to send data * on the requested endpoint. * * \param[in] hUsb Handle to the USB device stack. * \param[in] EPNum Endpoint number as per USB specification. * ie. An EP1_IN is represented by 0x81 number. * \param[in] pData Pointer to the data buffer from where data is to be copied. * \param[in] cnt Number of bytes to write. * \return Returns the number of bytes written. */ uint32_t (*WriteEP)(USBD_HANDLE_T hUsb, uint32_t EPNum, uint8_t *pData, uint32_t cnt);
Thank you Matt Sealey for the reply. Today I worked on the board and found that the problem was no the cast, which, as you suggested, worked properly, but the fact that the array I am trying to output is stored into the ram.It is declared as:
__DATA(RAM3) static uint32_t multiChannel[BINS];
If I remove the __DATA attribute I'm able to read properly the content, otherwise what I get are unexpected values.I'm opening a new question about this.Thanks again,Andrea