During co-processor flashing operation, I am getting error with my gateway. I think there is a gpio manipulation during flashing and the RAK2245 can’t communicate with CM3 via SPI. On the readme project, we need to enable uart (GPIO 32 and GPIO 33). On balenaFIn schematic, I see there is GPIO41 to select SW or UART of MCU.
In the balena-fin-firmata-flash project, I see in openocd configuration file , there is pin set for jtag protocol. JTAG pins are the same pins used for SPI communication (GPIO 9, 10 and 11)
Once co-processor is flashed, all service work correctly.
Do you know if JTAG pins are used during co-processor flashing process ? How can I do to ensure SPI communication during co-processor flashing stage?
I have a few questions that might help us narrow down the problem here:
When you say you’re using a “RAK2245 like” concentrator, does that mean that it’s that exact one or a similar module? I’m trying to understand if we can assume that the documentation of the RAK2245 fully applies to the module you’re using.
What is the error that you’re getting on your gateway?
When you send the instruction to the co-processor to enter sleep-mode, do you see the same error on your gateway?
You also need to keep in mind that right after flashing the co-processor, the balenaFin will reboot. That’s required for the serial interface between the co-processor and the compute module to work after flashing.
Yes in my case I am using the RAK2245 as lorawan gateway module.
I have a packet forwarder service deployed, this service is in charge of getting lorawan frame from gateway and redirect it to chirpstack server.
When the problem occurs, the gateway don’t exchange lorawan frames with the packet forwarder service. When i try to restart packet forwarder service, It can’t initialize communication with the gateway (via SPI).
The problem occurs only during a co-processor flashing process. I work around the problem in remove JTAG pins in openocd configuration file. ( finabler/balena-fin-v1.1.cfg at master · balenablocks/finabler · GitHub)
As co-processor uses only SWD protocol, flashing process works fine and I don’t loose lorawan frames.
Thanks for pointing this out. The JTAG pins shouldn’t be related to the co-processor flashing, but what you’re raising is interesting. One of my colleagues has a similar RAK module so we’ll try to reproduce this locally and find what the issue is. We’ll keep you updated.