2015-06-04 07:52 AM
I am using SPC560D30L3 with 8MHz crystal. The initialisation settings are as below,
1. IDF = 12. NDIV = 483. ODF = ODF_DIV8I have configured the serial for 38400 baud with buffer for 16 bytes. I am trying to send a frame of 7 bytes from PC (using hyperterminal or similar terminal utility). What I have observed is I am receiving only 2 bytes out of 7 - the first and last, in between bytes are lost. What is the problem? Are any setting missing?The two bytes received are correct, hence I have little doubt for baud setting. Am I correct? I tried different baud settings but same observations. What could be the problem?Is there any difference in configuration by selecting the Configuration->Identification->Board Identifier and Board Name as 'SPC56D_DISCOVERY' and 'STMicroelectronics SPC56D Discovery' as against the value 'generic SPC56D board'? I have observed that default clock settings differ between the two settings. First one gives XOSC clock as 16MHz and generic gives as 8MHz. Are there any configuration changes? Why these are so?Your earliest help in this regard will be highly appreciated. Thanks in advance.Mike.2015-06-09 01:20 AM
Referring to below post, I have observed that if I put a delay of 100mS (using function 'osalThreadSleepMilliseconds(100)' - not sure if it is true 100mS), the code functions correctly. Is there any relation of this function for overall code execution or is it required for SPC5Studio?
I have observed calls to this function in every test application provided. Any specific reason / relation for using this function?Your quickest help in this regard will be highly appreciated. Thanks.Mike.2015-06-10 06:23 AM
Hello Mike ,
Could you send me your application or code example ? which API do you use to get the byte from the terminal ? did you usechnReadTimeout(&SD1, &car, 1, TIME_INFINITE);
?
All the D Family are delivered in the mode ''STMicroelectronics SPC56D Discovery''
the default configuration for a discovery board is 16MHz (DISCOVERY)
The Mini Module + D Family are not provided for the Mass Market.
The default configuration for a Generic One is 8MHz (GENERIC)
Best regards
Erwan
2015-06-15 05:38 AM
I am using following API for reading the characters,
chnReadTimeout(pSD, pCommand->u8Data, pCommand->u8Length, TIME_IMMEDIATE);What is 'Mini Module + D family'? You mean all variants from D family.Thanks.Mike.2015-06-15 07:31 AM
Hello Mike ,
Minimodule (D Family) is not provided in ST Web siteit is a motherboard + a Minimodule + the device (D in this case).not the same price comparing to a discovery board.the default configuration for a discovery board is 16MHz (DISCOVERY)About your issue , maybe the best thing is to scan the character char by charchnReadTimeout(&SD1, &car, 1, TIME_INFINITE);
Could you give me an example of your application ?We will try to find the root cause. Best Regards Erwan2015-06-16 01:28 AM
Hello Erwan,
Regarding the API call, I see only two options for 'time' parameter -TIME_INFINITE and
TIME_IMMEDIATE.
Can I use custom value here? If yes how to use it?
If I useTIME_INFINITE
, will it wait forever till a character is received? I want to use a timeout value instead of waiting for character all the time. Please guide me how to implement this.
Thanks.Mike.2015-06-16 08:24 AM
1. I tried using '
TIME_INFINITE'
and it looks to be working but will it pose any risk in case the incoming frame gets broken in between as I am reading more than one character once I receive SOF (start of frame) byte?
2. I observed that with 'TIME_INFINITE'
, my code gets stuck after 3-4 frame reception, what is the cause? How can I flush the Rx and Tx buffers for fresh reception and transmission?
3. Any means to use a timeout value instead of 'TIME_INFINITE'?
Thanks in advance for help.Mike.2015-06-17 02:02 AM
Have you got an example of your application ?3- Time is the number of ticks before the timeout * @param[in] time the number of ticks before the operation timeouts, * the following special values are allowed: * - @a TIME_IMMEDIATE immediate timeout. * - @a TIME_INFINITE no timeout. Best Regards Erwan
2015-06-18 07:35 AM
Hello Erwan,
1. The SPC5_UARTSR_RMB looks to be working correct. It is getting set along with DRF but the frame is not received. What could be the reason?2. I tried using read API for single byte as well, only thing when I receive SOF, I used a for loop for no of bytes to read (here 7 bytes), each time reading single byte. But this also shows same behaviour.3. I tried reducing the delay from 100 to 25 (baud is 38400). It looks that with delay in main loop, it works but when I simply remove the delay I receive complete frame but with wrong values. Is it related to high baud rate value?4. You said only two values allowed for 'time' parameter for API. How about using a custom value of known time?Thanks for your help.Mike.2015-06-23 01:48 AM
Hello,
I am waiting for replies to above queries. Please respond.I am seeing following errors for few library files from SPC5Studio. Whether above observations for serial communication is because of these errors?Symbol 'bool' could not be resolved serial.c /ECU/components/portable_spc5_hal_component/lib/src line 204 Semantic ErrorSymbol 'NULL' could not be resolved serial.c /ECU/components/portable_spc5_hal_component/lib/src line 149 Semantic ErrorType 'size_t' could not be resolved serial.c /ECU/components/portable_spc5_hal_component/lib/src line 50 Semantic Error
Thanks in advance for your help.Mike.