thelsing / knx

knx stack (TP, IP and RF) for arduino and linux, Can be configured with ETS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SAMD21 lets to be programmed from ETS only once?

EugenElephant opened this issue · comments

Dear thelsing, first of all, huge respect and a big thanx for your work.

I use the library with Siemens TPUART. The microcontroller is Seeeduino XIAO (SAMD21).
Everything compiles fine. The knx-demo-tp works also just fine.
However there is an issue with programming the demo via ETS5:

  1. when I configure it via ETS5, the very first time after flashing the board, the physical address and the application programs are transferred to the board just fine.
  2. when I repeat the programming, the physical address is transferred, however the application program not. From the bus monitor it looks like the board just doesn't answer on certain requests.

In attachment you will find the recordings from the bus monitor for the 1st case when everything works just fine and for the second case when the programming of the application fails.

I haven't changed anything in the demo.
Any idea what can be wrong and how to fix it?

thank you.

best wishes
Eugen
bus_monitor_case1_everything_is_fine.txt
serial_output_case1_everything_is_fine.log
bus_monitor_case2_application_programming_fails
bus_monitor_case2_application_programming_fails.txt
serial_output_case2_application_programming_fails.log

commented

Hello all and thanks Thelsing for your great work.
I am using the same componants (Xiao Seeeduino + Siemens) and I have the same behavior.
I can only do a "complete programmation" on the participant, no partial programmation.
I test that with my own code and knxprog, but also with the demo code.
Regards

I think partial programming is a bit experimental. See #93. But you should be able to program only the application without the PA.
Its a bit hard to give advice. I would add printHex Calls to the read/writeUart functions in the platform to get a better understanding where the difference between success and failure is.

Have you tried to regenerate the knxprod file with the latest CreateKnxProd?

i have problems with both the knxprod from the samples as well as with the newly generated knxprod from the xml file (the XML file had to be adjusted first)

i have found the reason of the problem. Well the true reason is still unclear to me, but
the problem was caused by platformio in VS Code. I have defined the section:
[env:seeed_xiao]
platform = atmelsam
board = seeed_xiao
framework = arduino

which somehow resulted in including wrong libraries, so ARDUINO_ARCH_STM32 instead of ARDUINO_ARCH_SAMD was #defined

After switching the environments a couple of times and recompiling the project, the right library was included and ARDUINO_ARCH_SAMD was #defined

In order to make sure, that the right library is included, just have a look into the file knx_facade.cpp, the block after the code line:
#ifdef ARDUINO_ARCH_SAMD
should be shown enabled, the rest of the blocks should be disabled:

Bildschirmfoto 2021-11-15 um 20 55 12

commented

Thanks Eugen for your answer. I found the issue I had. I not correctly set the MASK_VERSION, it is why i removed my question.
To enforce the ARDUINO_ARCH_SAMD, I just put -DARDUINO_ARCH_SAMD=1 as extra parameters in platformio.ini.
Now everything is working well.
Regaards

This issue can be closed, can't it?