Skip to content

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

Merged
merged 53 commits into from
Jul 25, 2023

Conversation

ttmut
Copy link
Contributor

@ttmut ttmut commented Jul 13, 2023

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:

@ttmut ttmut added WIP work in progress MAX32690 Related to the MAX32690 (ME18) labels Jul 13, 2023
@ttmut ttmut self-assigned this Jul 13, 2023
@github-actions github-actions bot added BLE Related to Bluetooth and removed MAX32690 Related to the MAX32690 (ME18) labels Jul 13, 2023
@ttmut ttmut added MAX32690 Related to the MAX32690 (ME18) and removed WIP work in progress BLE Related to Bluetooth labels Jul 14, 2023
@github-actions github-actions bot added BLE Related to Bluetooth and removed MAX32690 Related to the MAX32690 (ME18) labels Jul 14, 2023
@ttmut ttmut marked this pull request as ready for review July 14, 2023 15:09
@ttmut ttmut removed the BLE Related to Bluetooth label Jul 14, 2023
/**************************************************************************** */
void mxc_assert(const char *expr, const char *file, int line)
{
printf("MXC_ASSERT %s #%d: (%s)\n", file, line, expr);
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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)

Copy link
Contributor Author

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.

@EdwinFairchild
Copy link
Contributor

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.
seen here:
808fd3e#diff-bfee91fe905e9af3e7b00f87fd7617bfc2cfbe5028309f016bc16c3325066e54R86-R100

printf("Press Push Button 1 (PB1/SW1) to continue...\n\n");

#else
printf("Press Push Button 1 (PB1/SW3) to continue...\n\n");
Copy link
Contributor

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

printf("Press button SW2 to begin example.\n");
#else
printf("Press button SW3 to begin example.\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as
#663 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

printf("Press SW2 to begin.\n");
#else
printf("Press SW3 to begin.\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as
#663 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@github-actions github-actions bot added MAX32690 Related to the MAX32690 (ME18) BLE Related to Bluetooth labels Jul 19, 2023
ttmut added 3 commits July 20, 2023 15:14
Enable printf only if DEBUG is explicitly stated so that the bootloader
can fit in 4000h bytes of allocated area.
Helps eliminate preprocessor conditionals.
@ttmut
Copy link
Contributor Author

ttmut commented Jul 20, 2023

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. seen here: 808fd3e#diff-bfee91fe905e9af3e7b00f87fd7617bfc2cfbe5028309f016bc16c3325066e54R86-R100

Thanks for the feedback. Disabling printf seems sufficient for now.

@sihyung-maxim sihyung-maxim merged commit 9a649af into main Jul 25, 2023
@sihyung-maxim sihyung-maxim deleted the dev/me18_fthr_apps_p1 branch July 25, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLE Related to Bluetooth MAX32690 Related to the MAX32690 (ME18)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants