Comments (14)
@picerno76 , Can you tell which device you see this issue?
from csp.
it's a PIC32MX150F128B
from csp.
@picerno76 , thanks for pointing out the issue. I am raising an internal ticket to get this fixed.
from csp.
Thank you. However, as I read in the documentation, this issue isn't only for this device but for all PIC32s
from csp.
@picerno76 , you are right. Bunch of bits in the UxSTA register are cleared when UART is disabled. You need to set some of these bits again after re-enabling the UART.
from csp.
of course I have already done it. I found out another issue. Sometimes when I change SerialSetup, if I'm receiving bytes on my UART the error interrupt flag is setted and never exit from interrupt service routine because OERR, FERR and PERR aren't setted
from csp.
@picerno76 , does it help if the UART is not disabled (and re-enabled) in the serial setup API?
from csp.
If I remove the disable/enable code, it seems that I don't have any issue, but I don't know if could be another hidden one. If you put that code for a reason, could be enough to set UTXEN and URXEN and clear UxEIF before enable the UART
from csp.
@picerno76 , well, the idea of disabling UART before changing the baud rate was to make sure that the baud rate is not changed while an active transmission is underway. Of course, this will not work well if a data reception is already underway as is in your case. Maybe a better solution is to wait for the RIDLE (Receiver Idle bit) bit in the UxSTA register before disabling the UART. But again, I don't think this a full-proof solution as receiver can again become active before the UART is disabled. In that case, the UART can be left enabled so that it generates RX errors normally. However, application must ensure that no transmission is underway before calling the serial setup API.
from csp.
well, the idea of disabling UART before changing the baud rate was to make sure that the baud rate is not changed while an active transmission is underway.
I undestand
Of course, this will not work well if a data reception is already underway as is in your case. Maybe a better solution is to wait for the RIDLE (Receiver Idle bit) bit in the UxSTA register before disabling the UART. But again, I don't think this a full-proof solution as receiver can again become active before the UART is disabled.
I agree
In that case, the UART can be left enabled so that it generates RX errors normally.
if you think it isn't a problem, of course it can be left enabled. I don't remember from what version I have updated my local repository but in tha past I didn't have this issue. Was it always enabled in previous versions?
However, application must ensure that no transmission is underway before calling the serial setup API.
if the application uses the driver, it cannot know if there is an underway transmission or am I wrong? However I didn't want to change the setup during a transmission but it happens in my initial setup in a board connected on a RS485 bus where there is already traffic
from csp.
if you think it isn't a problem, of course it can be left enabled. I don't remember from what version I have updated my local repository but in tha past I didn't have this issue. Was it always enabled in previous versions?
This change is recently introduced in csp v3.13.0. Older csp version does not have this change for pic32mx devices.
if the application uses the driver, it cannot know if there is an underway transmission or am I wrong? However I didn't want to change the setup during a transmission but it happens in my initial setup in a board connected on a RS485 bus where there is already traffic
You can use the DRV_USART_BufferStatusGet API to know the status of a submitted transmit request. You can also keep track of status of a transmit request by registering a callback with the driver and making sure you received a callback for all the submitted requests.
from csp.
This change is recently introduced in csp v3.13.0. Older csp version does not have this change for pic32mx devices.
I tried to switch to csp 3.12.0 in the content manager but the generator made the same code. Ok, I possibly made a mistake
You can use the DRV_USART_BufferStatusGet API to know the status of a submitted transmit request. You can also keep track of status of a transmit request by registering a callback with the driver and making sure you received a callback for all the submitted requests.
sure but this isn't my case. In the initial state, I haven't submitted any request yet
from csp.
@picerno76 , just checking if you are still blocked on this issue?
from csp.
the 3.13.1 version has fixed the issue. thank you
from csp.
Related Issues (20)
- SAM D5x/E5x Family 16-bit Timer data structure issue HOT 5
- There is a bug that BSP cannot be mapped in Function Type of Pin Settings. HOT 2
- UART Polling process problem HOT 8
- printf processing issue HOT 2
- NVM Driver Documentation missing function HOT 3
- SPI Library Documentation HOT 2
- 2 CANFD on PIC32MK1024MCM100 HOT 4
- Wrong variable usage in SPI slave tempates HOT 2
- Accessor to tickCounter in interrupt HOT 4
- exceptionsHandler.s.ftl HOT 2
- Vector Table incorrectly defined HOT 3
- Unable to update package using content manager HOT 1
- Harmony Configurator's Pin Configuration and Peripherals availability for SAMD10C14A differs from datasheet HOT 4
- PWM0_CH3 not listed in configuration for ATSAME70N19B HOT 3
- SMBus features request for PIC32MZ series devices. HOT 1
- Harmony Configurator's Pin Configuration and Peripherals availability for PIC32MK1024MCM100 differs from datasheet HOT 1
- Extended CAN template issue HOT 2
- PIC32MZW WTD reset clock initialisation HOT 3
- Infinite loop in SDHC driver.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csp.