docs icon indicating copy to clipboard operation
docs copied to clipboard

Incorrect information about attachSystemInterrupt for Boron

Open AndrewMoscoe opened this issue 3 years ago • 3 comments

https://docs.particle.io/reference/device-os/firmware/boron/#attachsysteminterrupt-

If I try to compile that example code for Boron, I get an error:

error: 'SysInterrupt_TIM5' was not declared in this scope
   22 |     attachSystemInterrupt(SysInterrupt_TIM5, timer_event_handler);

From a brief look at the deviceOS code, I think this function is for other platforms, and is not implemented for the Boron?

AndrewMoscoe avatar Nov 07 '20 16:11 AndrewMoscoe

@AndrewMoscoe, the Gen3 devices only have four usable timers:

0: Softdevice - do not use
1: Radio - Used by BLE (and mesh)
2: Usart (Serial1) Can use if not using Serial1.
3: Usart (Serial2 on Xenon) Cannot be used on Argon or Boron because it’s required by NCP.
4: NFC - recommended (unless you need NFC).

pkourany avatar Nov 08 '20 01:11 pkourany

Yes. The documentation for the Boron section of DeviceOS includes that block, which is wrong.

That system interrupt block also works for none of the four timers on the boron. From what I can see in the DeviceOS code, it is not implemented.

AndrewMoscoe avatar Nov 08 '20 03:11 AndrewMoscoe

@rickkas7, Gen3 devices do not have the same interrupt designations for timers nor do they have a timer5. The examples given for attachSystemInterrupt() and attachInterruptDirect() for Gen3 devices incorrectly refer to Gen2 interrupts and timers. There needs to be Gen3-specific examples.

pkourany avatar Nov 09 '20 15:11 pkourany