- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It seems that the max no. of bytes that could be transmitted at any one time using the API cyhal_uart_write() is 128.
For my application (e.g. bootloader) which requires transmission of 512 bytes at one go, what would be the recommendation?
Thank you in advance for any help/pointers.
Best Regards,
Syafii
Solved! Go to Solution.
- Tags:
- psoc6 uart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi SySa_4665481,
You can do the following:
Set the X and Y loops according to this formula given in PSoC 6 Architecture TRM
Let's say you want to transfer 500 bytes from Source to Destination. You can set the DMA configurator as follows:
I'm sharing the source files for the project I created that transfers 500 bytes of data from UART every 2 seconds. You can choose to trigger the DMA transaction whenever the application wants. You can set the source buffer, destination buffers, no of X loops, Y loops, source , Destination increment etc. in run time also using the descriptor related functions
PSoC 6 Peripheral Driver Library: Descriptor Functions
Review the design.modus file for the configuration settings for DMA and UART.
If the above example doesn't help, please feel free to post your sample code here, we will try to debug it here.
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi SySa_4665481,
You can use the API cyhal_uart_write_async() to transfer more than 128 bytes (TX FIFO size). This is a non-blocking function that initiates a UART transfer. The internal UART ISR takes care of further data transfer. The end of the event can be checked using callback event CYHAL_UART_IRQ_TX_DONE. f
See Snippet 2 : Hardware Abstraction Layer (HAL)
If you want to offload the CPU, you can make use of DMA to do the transfer.
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi BragadeeshV_41,
Thank you for the pointers.
I would like to use DMA for the transfer.
From the example, it seems like the transmit will happen upon trigger from the receive channel.
I would like to have a much simpler use-case whereby I would like to transmit after I have filled up the buffer.
I have been trying but no success yet.
Will you be able to provide me with an example for this use-case? Or some pointers on the configuration and APIs to use.
Best Regards,
Syafii
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi SySa_4665481,
You can do the following:
Set the X and Y loops according to this formula given in PSoC 6 Architecture TRM
Let's say you want to transfer 500 bytes from Source to Destination. You can set the DMA configurator as follows:
I'm sharing the source files for the project I created that transfers 500 bytes of data from UART every 2 seconds. You can choose to trigger the DMA transaction whenever the application wants. You can set the source buffer, destination buffers, no of X loops, Y loops, source , Destination increment etc. in run time also using the descriptor related functions
PSoC 6 Peripheral Driver Library: Descriptor Functions
Review the design.modus file for the configuration settings for DMA and UART.
If the above example doesn't help, please feel free to post your sample code here, we will try to debug it here.
Regards,
Bragadeesh
Bragadeesh