How firmware v0.4.4 affects libraries

Hi folks!

We’re really excited to release v0.4.4, but we’ve also noticed that it can cause a couple of issues with libraries (and code more broadly). The known problems are using PIN_MAP and #include “pinmap_impl.h"- both primarily used when adding Photon compatibility with Core code in things that use very low-level calls. You can fix the compile error and retain functionality by replacing PIN_MAP with PIN_MAP2 to eliminate a name collision and remove #include “pinmap_impl.h"

Here’s an example of fixed code from Neopixel that also allows different behaviors on Cores and Photons:

#if PLATFORM_ID == 0 // Core
  #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
  #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
#elif PLATFORM_ID == 6 // Photon
  //#include "pinmap_impl.h"
  STM32_Pin_Info* PIN_MAP2 = HAL_Pin_Map(); // Pointer required for highest access speed
  #define pinLO(_pin) (PIN_MAP2[_pin].gpio_peripheral->BSRRH = PIN_MAP2[_pin].gpio_pin)
  #define pinHI(_pin) (PIN_MAP2[_pin].gpio_peripheral->BSRRL = PIN_MAP2[_pin].gpio_pin)
  #error "*** PLATFORM_ID not supported by this library. PLATFORM should be Core or Photon ***"
// fast pin access
#define pinSet(_pin, _hilo) (_hilo ? pinHI(_pin) : pinLO(_pin))

The Neopixel, InternetButton, and deprecated SparkButton libraries have been fixed and the changes pushed out to the already in-use instances of those libraries. If you find other code or libraries that used to work but were broken by the update, post them here!


@Dick, how long does it usually take for new releases to make it on the webIDE?

Jumped the gun slightly, the update is still being applied :wink: It’s scheduled up be live in the next hour.


@dick, is there a way to tell from the webIDE or particleDev what revision is active without having to flash it to a device?

Hey @wesner0019 there currently isn’t an easy way to tell- that’s an update that’s coming soon. Also coming soon is that v0.4.4 firmware update- sounds like there are still some concerns that need to be tested, so we’re holding off. I’m going to unpin this topic until it’s going out.

1 Like

This topic is now unlisted. It will no longer be displayed in any topic lists. The only way to access this topic is via direct link.

This topic is now listed. It will be displayed in topic lists.