cesanta / mongoose-os

Mongoose OS - an IoT Firmware Development Framework. Supported microcontrollers: ESP32, ESP8266, CC3220, CC3200, STM32F4, STM32L4, STM32F7. Amazon AWS IoT, Microsoft Azure, Google IoT Core integrated. Code in C or JavaScript.
https://mongoose-os.com
Other
2.51k stars 430 forks source link

(ATECC508A) ATCA.SetConfig fails after UserExtra set #225

Open carldunham opened 7 years ago

carldunham commented 7 years ago

Not sure if this is really a bug or caveat emptor, but it seems that once the UserExtra byte is set to anything other than 0x00, it cannot be set again (enforced by the chip).

Because the ATCA.SetConfig RPC call sends the entire config, nothing after UserExtra will get set. This includes the KeyConfigs, sadly.

It might be helpful to break up SetConfig so that it can be called for individual sections. The atcab_write_bytes_zone() function seems to support this quite nicely.

In any case, dropping this here in case someone else runs into it.

rojer commented 7 years ago

so, even setting to the same value does not work? bummer. i'll do it, but may not get around to it for a while. in the mean time, PRs welcome. device's ATCA.SetConfig handler is here.

carldunham commented 7 years ago

Yeah, I guess the code could check to see if it's the same and non-zero, and skip over it. I may do that, will save me 0.75USD. :-)