-
Notifications
You must be signed in to change notification settings - Fork 108
feat(Examples): MSDK-1220: Review and update SDK examples #663
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
Conversation
Also fix implicit cast warning about float to double conversion.
BLE_otac and BLE_otas are not included since they require an external flash which is not available on the feather board.
Increase size of the flash section allocated to bootloader from 16kB to 40kB due to region overflow.
Use P1.11 as ready pin and update README.md.
FLC0 and FLC1 has different page sizes however the example code was using FLC0 page size to perform r/w/e tests on a page in FLC1. Fix this by using a page in FLC0 as test target.
Specify UART IRQ number and IRQ handler for UART0. RTS/CTS pins are also not used on MAX32690FTHR board.
Interrupt mode is not shown and input pin is changed from P2.11 to P1.11 when using MAX32690FTHR.
Do not prompt user to install jumpers if target board is MAX32690FTHR.
Use SW3 for button-triggered demonstration.
/**************************************************************************** */ | ||
void mxc_assert(const char *expr, const char *file, int line) | ||
{ | ||
printf("MXC_ASSERT %s #%d: (%s)\n", file, line, expr); |
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.
There should be
#ifdef DEBUG
printf("MXC_ASSERT %s #%d: (%s)\n", file, line, expr);
#endif
This will decrease code size for bootloader project, probably by adding this line the bootloader will be fit with existing flash area.
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.
Done.
#define EXT_FLASH_BAUD 4000000 | ||
#endif | ||
|
||
#define FTHR_APPS_P1 1 /// Used in examples to control program flow. |
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.
Lets double check board name with hw team,
they may just wish to call the board as FTHR.
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.
HW team prefer just FTHR, please rename it as FTHR to simplify things.
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.
Done.
@@ -32,7 +32,7 @@ | |||
******************************************************************************/ | |||
|
|||
BOOTLOADER_ORIGIN = 0x10000000; | |||
BOOTLOADER_LEN = 0x4000; | |||
BOOTLOADER_LEN = 0xA000; |
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.
Need to be double check after apply below change
#663 (comment)
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.
It fits inside 0x4000 after applying above change.
A change was made for MAX32655 examples with similar issue, the change was to not use the LED functions from the sdk and just implement the functions in the bootloader , thus by passing some asserts and other overhead from the msdk fucntions. |
Examples/MAX32690/Flash/main.c
Outdated
printf("Press Push Button 1 (PB1/SW1) to continue...\n\n"); | ||
|
||
#else | ||
printf("Press Push Button 1 (PB1/SW3) to continue...\n\n"); |
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.
In past i added PB_IsPressedAny function to able to eliminate this type comment,
https://github.com/Analog-Devices-MSDK/msdk/blob/main/Libraries/MiscDrivers/PushButton/pb.c#L133C1-L133C1
See usage:
https://github.com/Analog-Devices-MSDK/msdk/blob/main/Examples/MAX32672/Comparator/main.c#L79
It can simplify the startup messages too,
Due to it works in polling mode, the led delay can be decreased...
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.
Done.
Examples/MAX32690/CAN/main.c
Outdated
printf("Press button SW2 to begin example.\n"); | ||
#else | ||
printf("Press button SW3 to begin example.\n"); |
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.
Same as
#663 (comment)
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.
Done.
Examples/MAX32690/LPCMP/main.c
Outdated
printf("Press SW2 to begin.\n"); | ||
#else | ||
printf("Press SW3 to begin.\n"); |
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.
Same as
#663 (comment)
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.
Done.
Enable printf only if DEBUG is explicitly stated so that the bootloader can fit in 4000h bytes of allocated area.
Helps eliminate preprocessor conditionals.
Thanks for the feedback. Disabling |
Description
This PR adds MAX32690FTHR board support for examples targeting MAX32690. Most examples need no change to their source code and only require adding instructions on board setup into their readme files. The ones dealing with I/O require a few modifications due to having different pins routed to inputs and outputs.
Notable changes:
Commit 1d84ce4cecd65a78b7393bd32c18dfad74eb196e increases the size of bootloader section because it did not fit inside the allocated space.