cancel
Showing results for 
Search instead for 
Did you mean: 

How to select different buffer sizes for different UARTs on SPC560C50L3 controller?

vishrut nair
Associate
Posted on February 17, 2018 at 17:23

Hello Everyone,

I am currently working on SPC560C50L3 controller with SPC5 studio. My requirement is to use 4 UARTs. So, to enable that under 'SPC560BCxx Low Level Drivers Component RLA' option I 

selected 4 UARTs and under 'Serial Driver Settings' option I chose buffer size as 1500. Now after generating the code, my controller is taking 1500 bytes as the input and output buffer 

size for all the 4 UARTs, which means a total of 12000 bytes RAM size is already taken by the code because of the 4 UARTs. But I only want one UART with 1500 bytes buffer size and the rest UARTs

with 50 bytes. How do I select different buffer sizes for different UARTs?

Regards,

Vishrut.

2 REPLIES 2
Posted on February 18, 2018 at 19:03

Suggest you use the automated code generation to output 50 and 1500 options, and then diff the code to see what changes and what/where things get configured.

If this leads you to understand that the driver code won't provide the level of flexibility you want, then you might have to code your own solution to handle the odd case.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Erwan YVIN
ST Employee
Posted on February 19, 2018 at 16:42

Hello Vishrut ,

1500 Bytes for a buffer , it is very big for a microcontroller.

You can not change the configuration file generated :

/**
 * @brief Serial buffers size.
 * @details Configuration parameter, you can change the depth of the queue
 * buffers depending on the requirements of your application.
 * @note The default is 64 bytes for both the transmission and receive
 * buffers.
 */
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
#define SERIAL_BUFFERS_SIZE 16U
#endif
/** @} */
�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

With the patch mode in SPC5Studio, you can patch the file serial_lld.c and add this flexibility by using others constants :

#define SERIAL_BUFFERS_SIZE1 1500
#define SERIAL_BUFFERS_SIZE2 50�?�?�?�?

Best regards

Erwan