Swan software reset

I’m implementing a way of sending a software reset command to my device, so it jumps out of the loop() function and starts processing the setup() code again. How can I manage to do this with the Swan board?

With an arduino I can do it by calling a fake null function pointer, as bellow:

void(* resetFunc) (void) = 0;

loop()
{

resetFunc();
}

Paulohm,

One idea is to use a GIO pin for it and check the status of the pin in the loop.
From the notecard, you should be able to set the GIO pins. More information about setting or reading a GIO pin on the Notecard at card Requests - API Reference - Blues Developers

Regards,
rob Oudendijk

not sure if I get it. I was looking forf a line of code that I could call in order to restart the swan, as a reboot.

Hi @paulohm,

You can try using the NVIC_SystemReset(); method to perform a software reset.

Thanks,
Rob

No joy. Tried HAL_NVIC_SystemReset(); as well, but it does have the desired effect.

Paul (I assume that is your first name),

Did you try with a GIO assigned to an interrupt ?

Regards,
Rob Oudendijk

PaulO (close enough :slight_smile: )

Not sure if I understand your suggestion. Does this require extra wiring on my setup?

As far as I know there should be some pins connected between tthe Swan and the NoteCard. I have to check the schematic from the Notecard carrier and the Swan. From Blues.io website:

“The Swan embedded board is a single-sided PCB that includes a set of castellations to bring 55 I/O, power and ground pins from the STM32L4 on the board out to the edge. To access these pins, you can solder the Swan embedded to the Swan carrier board, or design your own PCB that leverages these pins.”

Regards,
Rob Oudendijk

Paul,

For the pins accessible, take a look at Blues Swan Datasheet - Blues Developers.

Regards,
Rob Oudendijk