Debugger support updates

RAK4630 RUI3
VS-code
JLink EDU or DAP

Hi People,
I’ve been hovering around this topic for a while now, and previous discussions never really found a solution.

I’d like to be able to use a debugger for code that sits over the RUI3 services. Currently I’m using VScode (on MacOS), using painfully slow code load cycles and playing guess and check with Serial.printf.

I have the Segger EDU with the cortex M10 connector, which I can break out to the SWD pins and I also have the RAKDAP probe, but I’ve never found my way through the configuration path to get either to work under the VScode environment.

I think @beegee has mentioned previously that RAK have a proper efficient dev environment internally.

Does anyone on the forum have a solution for live debug support on the 4630/RUI3 that they can share?

Cheers

Did you try Ozone debugger?
Not a VScode solution, but I used it with RUI3 before.

Not with any real effort.

I’ve been spoiled by the level of integration on tools I’ve been using for another project, but if Ozone turns out to be the only game in town I’ll push a bit harder with it.

Before I drill down into this whole SW dev problem yet again, can I just confirm the current state of the dev world.

I’m using the RUI3 firmware on the RAK 4631. I have something like 30K lines of application code sitting over the top of RUI3 and the Arduino dev environment is just an ugly space to be in, even within the VScode environment. There is no debug support for RAK h/w, no incremental compile and slow download.

@beegee Does the BSP for platformio include the RUI3 version or only the Arduino OS version? I haven’t got it working yet, and it might just be that it doesn’t work.

RAK released the RUI3 code as open source a few years ago with the promise that users could “Develop, compile, distribute, and contribute to your own firmware with ease.” I’m still not sure that this is where we are today.

If anybody on this forum can show a way to efficiently write big applications on top of the RAK 4631 RUI3, I’ll be delighted.

Thanks everyone.

There is a PlatformIO Board implementation out, but it is not maintained by us.

=> GitHub - maxgerhardt/platform-ststm32: ST STM32: development platform for PlatformIO

There is a branch called rak3172 and I used it in PIO like this:

[env:RAK3172-PIO-Kit-1]
platform = https://github.com/maxgerhardt/platform-ststm32.git#rak3172
board = rak3172_evalboard
framework = arduino
build_flags = 
	-DREGION_AS923_3=1
	-DSUPPORT_LORA=1
lib_deps = 
	electroniccats/CayenneLPP
	closedcube/ClosedCube OPT3001
	pilotak/LPS35HW

But as I said, it is not maintained by us and I do not know which RUI3 version it is based on at the moment.

Thanks Bernd. It doesn’t look like that repo isn’t going to help with the RAK4631 though.

I’m still kind of hoping that RAK will offer up official platformio support for the 4631 RUI3, but I’ve been waiting for this for a while now. Or any of the RUI3 platforms really.

Sorry, no plans for PIO support at the moment.

Our management is at the moment leaning more towards supporting Zephyr in the future.
We have basic examples available, @sercan can you share the repo link. I can’t find it.

@psupine Please take a look for Zephyr RTOS samples:

Hi @sercan,

I have used (and written) RTOS’s for many years. They certainly provide a convenience, but there is also always an overhead. I am really trying to avoid the RTOS layer in this particular project.

The RUI3 seemed to be a perfect match for what I wanting to do, but I’m left with the impression that RAK tried the idea, then released it to open source and walked away. I’m grateful that it went to open source and I acknowledge that. The RUI3 introduction pages on the website are so full of promise, but I don’t feel that RAK are really behind it anymore.

I’ve certainly put a lot of effort into using RUI3, but I’m now back at the evaluating all options phase. That said, I’ll probably stick with RUI3 and force my way through to some sort of debugger support, preferably under PIO but under Arduino if I have to, but I’ll spent a few days looking at the Zephyr option too. Thanks for the link.

Hi,

There are board ports for RAK modules in the Zephyr mainline kernel repository -zephyr/boards/rakwireless at main · zephyrproject-rtos/zephyr · GitHub
Also I confirmed that RAK3172 and RAK4631 worked.

1 Like

I kind of need to pivot a little bit from the original post, but I think it is still really the same topic (SW dev support), so I will keep on this thread.

It’s not intended as a rant, but it’s a long post, so I won’t mind if you (dear reader) just skip it.

I’ve been looking at various Zephyr doco and commentary sites.

IMHO … it seems that:

The interest in Zephyr is only because ARM walked away from Mbed two years ago and Arduino began a transition to Zephyr as a replacement. It’s not necessarily a great step forward, simply one of necessity. Some people like Zephyr, some see bloatware; different tribes.

Good SW dev environments sell hardware. Bad SW dev environments drive developers away (eventually - they only find out how bad tools are after they’ve moved past the promises and tried to use them). It’s in the interests of HW vendors to provide good SW development tools for their own hardware, but it is absolutely against their interests that their tools work for the competition’s hardware. They want HW lock-in - that is they discourage an easy transition to alternative hardware. They also provide relatively cheap debug probes that are restricted to their own hardware. I have half a dozen of them. It is often a rebadged Segger probe, with firmware restrictions. The commercial (non-EDU) Segger probes are universal but expensive.

Now that Qualcomm has bought Arduino, the whole idea of Arduino providing SW portability across different HW is, I think, on somewhat shaky ground. Qualcomm is a chip maker. Anything they do in the Arduino space has to be about them selling more of their chips. They could have just made some Arduino compatible boards and joined the club, but instead they bought control and they will certainly want return on investment.

Good SW tools are expensive to develop and maintain, and there seems to be a gradual migration away from in-house tools towards providing externions to the VScode umbrella. This concentration makes things like the Black Magic debug probe much more viable since it can be a GDB server for a raft of chips. That’s now tricky for the HW vendors because they are damned either way - either maintain their own expensive tools or lose the HW lock-in.

Even Segger have decided to support the VScode environment, but I think that they will struggle against the BM probe unless they seriously rethink their pricing.

These are interesting times.

I imagine that RAK would like to keep SW portability across its various processing HW options because it helps customers choose RAK repeatedly. This requires a significant effort from RAK. I have been hanging around the RAK community since 2020 ( my first order was #4631 - how ironic! ) and I am still frustrated at the SW tools. They are still a mess. I know it’s hard, but it is really important!

To be compatible with future RAK if I need to port my app away from a RUI3 “bare metal” service layer, what API should I be using? Should I still be using the Arduino API, and it’s just Zephyr under the hood rather than Mbed, or is the future based around the Zephyr API directly?

It seems to me that if you want to pick up and retain customers who started with Arduino, then you need to stick with the Arduino API and put real effort into RUI3 - fix the boot loader chaos and provide the BSP that enables debugger support. If you want to pick up customers who already use Nordic Connect SDK or the other equivalent options from STM32 or Ambiq Apollo, then I can’t see the point in going through the Arduino API.

I could well be wrong on various points, but I’m currently trying to work out which is the best way for me to move forwards. I would welcome any feedback from RAK or from any other forum members who read all the way to the end.

It depends on you. If you’re about to use Zephyr instead of RUI3, you may have to give up some of the features already supported by RUI3. You will have to write almost everything manually. For example, Zephyr is basically standalone. If you want to use FUOTA, you will need to use Sysbuild (Sysbuild (System build) — Zephyr Project Documentation) and issue signing keys for secure booting. In Addition, for continuous rejoining to the LNS after reboot, to permanently store the DevEUI, JoinEUI, DevNonce and etc, you need to relocate the flash partitions in the dts overlay file to allocate space for NVS.

About Debugging with VS Code, the document for cppdbg feature will may help you - Configure C/C++ debugging

Hi @psupine

Actually, RAK continues to provide support for RUI3. So, you can use it without a problem. Debugging is harder for RUI3, I agree with you. However, this is because of the Arduino environment. It is obvious that debugging is a lot easier with Zephyr RTOS.

Currently, there is no decision that RAK will continue with Zephyr RTOS. I cannot talk about future API. To be honest, I do not have any idea. As @JaeHwan.Jin said, it depends on which way you will choose.

I have one more link for you: https://github.com/srcnert/RUI-APOLLO3-ARMGCC
I prepared this repo for RAK11720 (Apollo3 Blue). I am using RAK’s Arduino SDK and I am able to compile it without using Arduino IDE. I prepared my own makefile. It is also possible for you to prepare this type of environment for RAK4631. Please be aware that this is not east.

Lastly, you can try to use Ozone debugger or gdb. If you can open verbose logging on Arduino IDE, you will see the location of the elf file on your operating system. You can use this elf file to debug your project with J-Link Ozone debugger. Again, it will not as easy as Zephyr or Bare Metal project debugging. But, it is possible to debug RUI3 project with J-Link Ozone debugger in my opinion.

Best regards,
Sercan.

Thank you both for your feedback.

I probably sound grumpy, but there’s actually a lot I really like about the RAK world and I’m very happy with WisBlock modules and using RUI3.

My application uses the radio links (LoRa, BLE and GNSS) only once every 30 minutes or so. The rest of the time I’m using the 4631 processor as a DSP engine and to interface with two custom boards, one via UART and one via I2C.

My two custom boards use SAM10L processors as expansion ports to additional sensors as well as handling some dedicated hard realtime control tasks. This means that as long as the WisBlock Core can keep up with the dataflow the realtime processing limits are soft.

Serial.printf has worked for me so far, but the code on the RAK4631 is getting more and more complicated and this is why I’m now trying harder to find a debugger solution.

Again, thanks for the feedback and links.

@sercan: I get a 404 on your Apollo3 link above.

@psupine You can reach link now.

Thanks. I can see the repo now.