Transmit large data through UART OR Ethernet
hello everyone
I followed the AN4666 to read data from GPIOC ports triggered by timer input capture mode and save into a large buffer of uint8 in size of (510000) arrays, all I want to do is to transmit the full buffer after the reading operations is complete to my pc.
I have tried transmitting it through UART but I realized that the maximum size I can transmit is 65535 bytes before it stops. also if I used circular mode the the pointer will start from the beginning.
/* Includes ------------------------------------------------------------------*/
#include "main.h"
* USER CODE BEGIN PD */
#define MAX_FRAME_SIZE 458745
/* Private variables ---------------------------------------------------------*/
TIM_HandleTypeDef htim1;
TIM_HandleTypeDef htim2;
DMA_HandleTypeDef hdma_tim1_ch1;
UART_HandleTypeDef huart3;
DMA_HandleTypeDef hdma_usart3_tx;
PCD_HandleTypeDef hpcd_USB_OTG_FS;
/* USER CODE BEGIN PV */
const uint8_t aFull_Buffer[MAX_FRAME_SIZE];
/* USER CODE END PD */
int main(void)
{
htim1.hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TransferComplete;
// Start DMA in interrupt mode, specify source and destination
HAL_DMA_Start_IT(htim1.hdma[TIM_DMA_ID_CC1], GPIOC_IDR, (uint32_t) &aFull_Buffer, MAX_FRAME_SIZE);
// Enable timer to trigger DMA transfer - CC1DE bit
__HAL_TIM_ENABLE_DMA(&htim1, TIM_DMA_CC1);
// Enable timer input capture
HAL_TIM_IC_Start(&htim1, TIM_CHANNEL_1);
while (1) {
}}
static void TransferComplete(DMA_HandleTypeDef *hdma_tim1_ch1) {
HAL_UART_Transmit_DMA(&huart3,aFull_Buffer,MAX_FRAME_SIZE );
}I was able to receive only 65535 bytes because I know that (max size of transmit function is 16 bits= 65535)
- can I do multiple uart transmissions but with different start points from my buffer?
- Is there a way to transmit data through Ethernet ?
