-
Notifications
You must be signed in to change notification settings - Fork 983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microbit v2 specific features #763
Microbit v2 specific features #763
Conversation
-Added ROM setting to enable/disable feature via .cfg files. -Implemented hook at flash_decoder layer once the first 12 vectors are obtained (flash decoder min size)
-hook for custom reset button handling -hook for 30ms event tick -hook for power down event -usb state udpate
-Add KL27Z NXP drivers -Power monitor (detect power source) -Board Rev Id detection -i2c support -low power support -button and LED handling
-build filesystem hook for error blob app and DATA.BIN file creation -Added microbit custom BL project for custom URL in HELP_FAQ.HTM -I2C comms and flash interface -SWD clock speed improvements
-Make power LED remain active in VLPS mode. Changed FlexIO source clock to one that is active in VLPS. -Removed NRF Power mode property -Added Power LED sleep state property -Changed size of properties 0x01-03 to 2B
…le. Add documentation on the feautre.
…, .txt, .csv, .htm, .wav).
-Add property for Kl27 user event (wakeup or long button press) -Blink LED when attempting to enter deep sleep but are PC connected -Hold interrupt line to send I2C message on reset long press -Clear I2C responses after first read in the comms interface
-Change wake up when the reset button is pressed instead of released -Add hook in bootloader project to bypass reset button check to jump directly to the interface -Reset the nRF whenever we wakeup from the reset button independently of the press duration
-Keep red LED ON after a long press. -When the reset button is pressed, the KL27 will reset the `Power LED Sleep state` value to the default ON -Red LED in deep sleep mode now depends on the `Power LED Sleep state` it can be either HIGH or LOW but no PWM.
…ew event so the nrf can see the new edges.
…this command doesn't assert the interrupt line.
…SENSOR_INT caused by WAKE_ON_EDGE
…e.g attaching usb device to VM)
… of waiting to the main loop poll to update the status.
… getting PWR_SOURCE_NONE.
-Add support for reading flash config data -Change filesize to bytes instead of KB -Fix address ranges in erase storage cmd -Add more validations to different commands
- Set backdoor key to 'MICROBIT'. - Enable FPROT for first 32 kB of flash. - Fix FPROTx numbering according to KL27 RM, where FPROT3 is at address 0x408. - Enable backdoor key in FSEC. - Added asterisks next to selected options in comments for FOPT and FSEC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a couple of clarifications/notes and questions we had.
Thanks for the PR! I probably won't be able to get to it until this weekend at the earliest. |
# Conflicts: # records/tools/version.yaml Resolved using DAPLink version 256 from master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies for taking so long to review! There are a couple things on my list to come back to look at again. Overall, really good work! My comments are mostly nitpicks. 😉
update formatting made microbit specific changes to be board configurable via yaml files
|
||
if (sector_offset != 0) { | ||
if (sector_offset > 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably depend on the value of BOARD_EXTRA_BUFFER
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated calculation.
Consider BOARD_EXTRA_BUFFER in sector offset calculation Follow ADIv6 for powering down the debug interface Add comment to .yaml file on DELAY_FAST_CYCLES Don't erase target image if incompatible image is enabled and triggered.
90b6221
to
44a2522
Compare
// TODO: put the interface chip in sleep mode | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed that the while(1);
from main()
is missing here.
It's probably ok if the main loop keeps running, and might actually be better: RTX will block on the osThreadFlagsWait()
call and enter the idle thread which will WFI.
But has this been tested on a build without the micro:bit override of this hook? (Is there even a way to enter powerdown for "normal" builds?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly I initially had the while(1); in the weak function, but this had strange behavior where the code wasn't executing correctly in the "strong" custom function. I think it had to do with how the compiler optimizations were working. Something about the optimizations being done per file, without knowing that there was a "strong" function definition elsewhere. That and the combination of having an endless loop in the weak function, made the optimizations assume wrong things.
I don't see any build that uses the main_powerdown_event() to trigger this event, so the while(1) was probably a placeholder and there's no impact by removing it, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, cool. Nothing to worry about then. Thanks for the quick answer!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. Really fantastic work @gerargz!
The only outstanding question is the new one about the missing while(1);
from the powerdown hook. Ideally I'd like to get an answer before this is actually merged, but it's not a big deal either way.
All questions addressed, ready for merge! 🚀 |
Draft PR with microbit v2 specific features. This contains the commit ID for the DAPLink build used by the factory release of the microbit v2 boards.
This PR is still a draft as it contains modifications to the DAPLink core that may not be upstream friendly.