Comments (3)
Can you explain in more detail, what you are doing? Are you sending NMT commands twice, or accessing API functions multiple times? I need to investigate this in my environment to fix the software (or documentation) ;-)
from canopen-stack.
Hi, I found this issue during some tests.
So to give more details on the system : I got a node configured with a PDO in asynchronous mode, with a 1s event timer, working normally in operate state.
Then I send an NMT command to go to the operate state (which, we agree is useless because it is already in).
I was surprised to see the period of my PDO changing : twice more messages.
After this I repeated the send of NMT operate commands, each one adding one new PDO message periodically send by the device !
I did not kept the traces, but if you can't reproduce this easily, I can illustrate with some captures.
It's not a critical bug, just some curious behavior...
I noticed also that going to pre-operate works normally and after, a new command to go to operate results in a normal behavior.
From the code I imagine that some timers are created for PDOs on the Operate command, which is done even if the node is already in the Operate mode...
Best regards and thanks for this stack ! :)
Sylvain
from canopen-stack.
You are right, thank you for the investigation!
Analysis
This is a bug in function CONmtSetMode(). This function initializes the transmit and receive PDOs each time, this function is called.
The correct behavior is: initialize PDOs when entering the operational mode only.
Solution
No workaround is possible.
Change of the function for the next release. For example:
void CONmtSetMode(CO_NMT *nmt, CO_MODE mode)
{
if (nmt == 0) {
CONodeFatalError();
return;
}
if (nmt->Mode != mode) {
if (mode == CO_OPERATIONAL) {
COTPdoInit(nmt->Node->TPdo, nmt->Node);
CORPdoInit(nmt->Node->RPdo, nmt->Node);
}
CONmtModeChange(nmt, mode);
}
nmt->Mode = mode;
nmt->Allowed = CONmtModeObj[mode];
}
Testsuite
We need an additional test in the test suite:
- changing NMT state from operational to operational
from canopen-stack.
Related Issues (20)
- generate source package with release v4.4.0
- quickstart is moved to own repository
- Not able to find object dictionary file in the stack and no idea which tool need to use to generate the EDS file HOT 4
- Implementation on TI C2000 MCU with 16-bit bytes HOT 6
- Variable Block Download block sizes HOT 3
- Failed to link files HOT 2
- DSP: Integer16 is not read as expected HOT 7
- reentering an abandoned segmented SDO session
- protocol boot-up spec possibly followed incorrectly HOT 1
- EMCY Service Err Index Size
- Bugfix for COSDO Segmented Download
- Size of buffer during NVM read
- Problems with RPDO dummy mapping - potential array out of bounds write HOT 2
- Linux port of the stack HOT 1
- COTPdoMapWrite: Add error checking to prevent uninitialized variable access.
- SDO timeout message after SDO request was successful
- How to tailor the lib to run on small-size MCU
- COTmrService stops all timers on failed CO_IF_CAN_DRV.Send?
- CAN communication stopped after creating CANOpen node.
- How to: master and more than default number of PDOs HOT 2
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 canopen-stack.