LeonidPr
Hi,
 
i'm very new to OpenPLCEditor so i'm curious if there is any documentation about debugging support?
I have a GigaDevice Cortex-M4 MCU board that i want to use as PLC hardware.
So i need an information how to support program downloading and what do  i need to implement in my firmware to support debugging?
 
Thank you in advance.
Reply 0 0
thiagoralves
OpenPLC implements a generic runtime on top of the Arduino API. If your board is Arduino-compatible then all you have to do is add it on the editor/arduino/examples/Baremetal/hals.json. If your device is not Arduino-compatible then… well, I would just give up! You would have to rewrite the runtime and provide your own toolchain, which is a lot of work.
Reply 0 0
LeonidPr
No, it's my own board that doesn't support arduino API.
Is there any documentation for adding your own board and implementing runtime for that?
Reply 0 0
thiagoralves
You would have to rewrite everything pretty much from scratch
Reply 0 0
LeonidPr
Is there any developer's documentation that could help with that?
Reply 0 0
LeonidPr
I don't think that i would need to rewrite the whole editor, matiec or other parts. I suppose that i need to implement only protocol that is used for interaction between IDE and target that runs firmware and PLC runtime, isn't it?
Reply 0 0
thiagoralves
I didn’t say you would have to rewrite the IDE. That doesn’t make sense. I said you would have to rewrite the runtime, which is true. Unfortunately there isn’t any developer documentation, but the code is pretty much straightforward to understand. The debug protocol was written on top of Modbus, so if your target implements Modbus you only need to add support for the extra custom Modbus function codes that makes the debugger work. The protocol frames are all documented in the code (ModbusSlave.cpp)
Reply 0 0
LeonidPr
Thank you for information. Seems i misunderstood you when i said about whole IDE. Will look at current implementation of Modbus_Slave
Reply 0 0
LeonidPr
What's the official repository of the currently supported Runtime?
Reply 0 0
thiagoralves
Main file is at examples/Baremetal/baremetal.ino
Reply 0 0
LeonidPr
Thank you!
Reply 0 0
Reply