Comments (19)
Latest working Commit is 4ef5134
from knx.
That seems to be the same problem as #53 . It would be very nice if you could debug the issue. My SAMD21 test setup is not working ATM.
from knx.
You are right, sounds same. Will try to debug.
from knx.
I'll continue this topic here because the linked Issue title is unrelated.
The issue is here:
Line 214 in cc1fc7d
tracking:
knx/src/knx/interface_object.cpp
Line 126 in cc1fc7d
to this function, which does not return properly:
Line 26 in cc1fc7d
Unfortunately if I add any print() in this function the sketch does compile but doesn't run on my Zero clone. @mjm987 any luck?
from knx.
No unfortunately I had no luck yet, it is hard to debug without SWD Debug Probe.
May be it is a race condition between the main loop and ISRs?
Does anybody know what is handled in ISRs?
I guess all the knx stuff except the SPI- and UART- IO are handled in the main flow isn't it?
May be it happens when a Interrupt raises during the FlashStorage handling?
I don't think it is a stack, heap or buffer overflow during main flow itself.
from knx.
I used a different sketch now and compared the loggings:
Arduino Debug output.txt
The interruption happens every time at the same point, so I don't thing any ISRs cause this. To me it looks like a memory allocation issue, since my project outputs "No available non volatile memory!"
However I can't debug this without debugger.
from knx.
Maybe the problem is here
Line 208 in cc1fc7d
I just checked ESP8266 and it still works. I bricked my samd board so I can't check..
from knx.
@Sonnengruesser can you add which property is written to debug output?
from knx.
initGroupObjects seems to hang. But I don't understand why.
from knx.
initGroupObjects seems to hang. But I don't understand why.
at least on my Zero (SAMD21) it does not hang in initGroupObjects but somwhere (unknown) else
from knx.
I tried to find the cause, but I wasn't successful. I ordered Segger Jlink Edu Mini now.
from knx.
Today I got the debugger, but the knx power supply of my testbed died. ;(
Anyways I debugged the whole evening and still don't understand the error. The debugger goes straight to the hardfault handler at simple lines like htons(...).
I'll try the working version next.
from knx.
may be be a alignment error?
from knx.
I got openocd running using my nrf52 DK as debug interface and yes, it is a alignment error at the end of the code sequence below when accessing to _tableData[0] because _tableData is on a odd address!
bool GroupObjectTableObject::initGroupObjects()
{
println("initGroupObjects() - start");
if (!_tableData) {
println("initGroupObjects() !tableData");
return false;
}
freeGroupObjects();
uint16_t goCount = ntohs(_tableData[0]);
@telsing Could you align _tableData to a even address?
from knx.
Ok it works!
As I expected, the problem is a int16 or int32 access to a odd address.
This could be corrected by replacing htons(x) and htonl(x) in "bits.h" by:
#define getbyte(x,n) (*(((uint8_t*)&(x))+n))
#define htons(x) ( (getbyte(x,0)<<8) | getbyte(x,1) )
#define htonl(x) ( (getbyte(x,0)<<24) | getbyte(x,1)<<16) | (getbyte(x,2)<<8) | getbyte(x,3) )
Of course the same might be done by using a union.
And still a bit more efficient would be to align _tableData to a even address because saving multiple bus accesses.
@thelsing: Could you please after verifying update bits.h accordingly?
Thx
from knx.
@mjm987 I just committed this. I don't have time to test ATM.
from knx.
Commit fixed the issue on the KNX Demo project for me. My other project still doesn't run and gives the "No available non volatile memory!" message. I think this is related, so I keep this issue open for the moment. trying to get rid of stuff on my sketch for further troubleshooting.
from knx.
According the "No available non volatile memory":
Did you try to increase EEPROM_EMULATION_SIZE form 1024 to eg. 2048 in FlashAsEEPROM.h ?
from knx.
Changed my mind, my problem is probably unrelated. Closing this issue now.
from knx.
Related Issues (20)
- TPUART - Strange connection issue with Samd21 & TP HOT 1
- Unhandled service identifier: 20B on ESP8266 HOT 1
- is it possible to get knx product certification using this stack. HOT 1
- Device programming via ETS HOT 3
- getting error communicating with NCN HOT 1
- DPT 1.24 and 1.100 missing
- Transmitting Telegrams Over KNX Bus Error HOT 1
- cemi_frame.cpp
- big flash size though eeprom warning
- Issue on decoding DPT 10.001 values - "Index" HOT 3
- callbacks missing occasionally HOT 1
- Pass through KNX-bus to Serial with H8C09 board HOT 6
- Debug message since commit 338aa1b of 2023-05-28 maybe inconsistent ? HOT 8
- Update PlatformIO Registry Version and Example Projects HOT 2
- Arduino ethernet sheild supported?. HOT 1
- CI Pipeline broken HOT 1
- Basic documentation HOT 6
- Missing ARDUINO_ARCH_RP2040 in knx/bits.h HOT 7
- KNX-Demo no prog status in ETS HOT 1
- compiling doesn´t work HOT 5
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 knx.