### Get MSDK Installer Help Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Displays available commands and options for the MSDK installer when run from the command line. This is the primary way to discover the installer's functionality. ```shell $ ./MaximMicrosSDK_linux.run --help ``` -------------------------------- ### VS Code Intellisense Path Setup Example Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Illustrates how to add custom search paths for Intellisense in VS Code by modifying the `.vscode/settings.json` file. ```JSON { "C_Cpp.default.includePath": [ "${workspaceFolder}/drivers/**", "${workspaceFolder}/libraries/CMSIS/Include/**", "${config:ARM_GCC_path}/riscv-none-elf/include/**" ], "C_Cpp.default.browse.path": [ "${workspaceFolder}/drivers", "${workspaceFolder}/libraries" ], "C_Cpp.default.defines": [ "MCU_SERIES=7" ] } ``` -------------------------------- ### Startup Log Output Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats This section shows the typical log messages observed when the device initializes and starts up. It includes initialization steps, database calculations, and event handling. ```log terminal: init 32kHz trimmed to 0xF DatcHandlerInit Calculating database hash Datc got evt 32 >>> Reset complete <<< Datc got evt 58 Database hash calculation complete Datc got evt 21 Database hash updated dmDevPassEvtToDevPriv: event: 13, param: 1, advHandle: 0 Datc got evt 63 Datc got evt 153 dmDevPassEvtToDevPriv: event: 12, param: 36, advHandle: 0 Datc got evt 36 >>> Scanning started <<< ``` -------------------------------- ### Install Ubuntu Prerequisites Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Installs essential GUI packages required by the QT installer framework on Ubuntu systems before running the MSDK installer. ```bash sudo apt update && sudo apt install libxcb-glx0 libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-util1 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb1 libxkbcommon-x11-0 libxkbcommon0 libgl1 libusb-0.1-4 libhidapi-libusb0 libhidapi-hidraw0 ``` -------------------------------- ### Startup Logs: Device Initialization Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats Logs observed on device startup, showing initialization sequences, advertising configuration, and successful advertising start. ```terminal terminal: init 32kHz trimmed to 0x16 DatsHandlerInit Dats got evt 32 >>> Reset complete <<< dmAdvActConfig: state: 0 dmAdvActSetData: state: 0 dmAdvActSetData: state: 0 dmAdvActStart: state: 0 HCI_LE_ADV_ENABLE_CMD_CMPL_CBACK_EVT: state: 3 dmDevPassEvtToDevPriv: event: 12, param: 33, advHandle: 0 Dats got evt 33 >>> Advertising started <<< Dats got evt 21 Database hash updated ``` -------------------------------- ### Build Example Project Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Executes the build process for the copied example project. This command compiles source files and links them into an executable binary. ```shell make ``` -------------------------------- ### Example CLI Handler Function Source: https://analogdevicesinc.github.io/msdk/Libraries/CLI This is a sample handler function for a 'make directory' command. It takes arguments from `argv` and calls an underlying `mkdir` function. ```c int handle_mkdir(int argc, char *argv[]) { mkdir(argv[1]); return 0; } ``` -------------------------------- ### Eclipse MSDK Setup Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Ensure the 'Eclipse' component is selected during MSDK installation or retrieve it via the Maintenance Tool. This section serves as a quick-start for creating, building, and running projects within Eclipse. ```bash # MSDK Installation Check # Ensure 'Eclipse' component is selected. # Or use Maintenance Tool to add/update components. ``` -------------------------------- ### MSDK Installer CLI Commands and Options Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Details the usage syntax and lists the core commands and options available for the MSDK installer's command-line interface. This includes installation, update, removal, and listing functionalities. ```APIDOC Usage: ./MaximMicrosSDK_linux.run [options] command Commands: in, install - install default or selected packages - ch, check-updates - show available updates information on maintenance tool up, update - update all or selected packages - rm, remove - uninstall packages and their child components - li, list - list currently installed packages - se, search - search available packages - Note: The --filter-packages option can be used to specify additional filters for the search operation co, create-offline - create offline installer from selected packages - pr, purge - uninstall all packages and remove entire program directory Options: -h, --help Displays help on commandline options. ``` -------------------------------- ### Headless SDK Installation (Windows) Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Installs the Maxim Integrated SDK in headless mode on Windows, specifying the installation directory. Requires elevated permissions. ```powershell .\MaximMicrosSDK_win.exe in --root C:/MaximSDK ``` -------------------------------- ### Example Command Invocation and Tokenization Source: https://analogdevicesinc.github.io/msdk/Libraries/CLI When a user enters a command like 'mkdir new_folder', the CLI library tokenizes it into arguments. 'mkdir' becomes argv[0] and 'new_folder' becomes argv[1], with argc set to 2. ```shell mkdir new_folder ``` -------------------------------- ### MSDK Build System: Example Configuration Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Example of setting the MFLOAT_ABI configuration variable in project.mk to enable hardware floating-point acceleration. ```makefile # This file can be used to set build configuration # variables. These variables are defined in a file called # "Makefile" that is located next to this one. # For instructions on how to use this system, see # https://analogdevicesinc.github.io/msdk/USERGUIDE/ # Enable hardware floating-point acceleration MFLOAT_ABI=hard ``` -------------------------------- ### Headless SDK Installation (Linux/macOS) Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Installs the Maxim Integrated SDK in headless mode on Linux or macOS, specifying the installation directory. Requires elevated permissions. ```bash sudo ./MaximMicrosSDK_linux.run in --root ~/MaximSDK ``` -------------------------------- ### MAX32657 Hello World Non-Secure Example Source: https://analogdevicesinc.github.io/msdk/USERGUIDE This example provides a 'Hello World' demonstration for the MAX32657 microcontroller in a non-secure execution environment. It is part of a TrustZone (TZ) security demonstration. ```C Examples/MAX32657/Hello_World_TZ/NonSecure ``` -------------------------------- ### MAX32657 Hello World Secure Example Source: https://analogdevicesinc.github.io/msdk/USERGUIDE This example provides a 'Hello World' demonstration for the MAX32657 microcontroller in a secure execution environment. It is part of a TrustZone (TZ) security demonstration. ```C Examples/MAX32657/Hello_World_TZ/Secure ``` -------------------------------- ### Verify Installation Ownership (Linux/macOS) Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Lists the contents of the installation directory with detailed information to verify ownership on Linux or macOS after changing it. ```bash ls -la ~/MaximSDK ``` -------------------------------- ### Flash Example Project with OpenOCD Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Flashes the built example project onto the target hardware using OpenOCD. This command is a convenience target provided by the MSDK to automate the flashing process. ```shell make flash.openocd ``` -------------------------------- ### Unattended SDK Installation (Linux/macOS) Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Performs an unattended installation of the Maxim Integrated SDK on Linux or macOS, automatically accepting licenses and messages. Requires elevated permissions. ```bash sudo ./MaximMicrosSDK_linux.run in --root ~/MaximSDK --accept-licenses --accept-messages --confirm-command ``` -------------------------------- ### CLI Commands and Button Interactions Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats Documentation for the command-line interface and button press behaviors, including command syntax, parameter descriptions, and state-dependent button actions. ```APIDOC CLI Commands: help - Displays the available commands. echo (on|off) - Enables or disables the input echo. On by default. - Parameters: - (on|off): The state to set for input echo. btn (ID) (s|m|l|x) - Simulates button presses. - Example: "btn 1 s" for a short button press on button 1. - Parameters: - ID: The identifier of the button (e.g., 1, 2). - (s|m|l|x): The type of press: 's' for short, 'm' for medium, 'l' for long, 'x' for extra long. pin (ConnID) (Pin Code) - Used to input the pairing pin code. - Parameters: - ConnID: The connection identifier. - Pin Code: The PIN code for pairing. Button Press Definitions: short: press is less than 200 ms medium: press is between 200 and 500 ms long: press is between 500 and 1000 ms extra long: press is greater than 1000 ms Button Actions: When disconnected: 1. Button 1 short press: Start advertising 2. Button 1 medium press: Enter bondable mode 3. Button 1 long press: Clear all bonding info 4. Button 1 extra long press: Show version info 5. Button 2 short press: Stop advertising When connected: 1. Button 2 short press: Change PHY (1M-2M-Coded_S2-Coded_S8) ``` -------------------------------- ### MAX32655 Bluetooth Data Server Example (Second App) Source: https://analogdevicesinc.github.io/msdk/USERGUIDE This example implements a Bluetooth data server for the MAX32655, advertising as 'OTAS' and accepting connection requests. It is similar to the BLT example, potentially offering alternative functionality or implementation. ```C Examples/MAX32655/Bluetooth/BLE_HCI_DFU/Second_App ``` -------------------------------- ### PR Title Examples Source: https://analogdevicesinc.github.io/msdk/CONTRIBUTING Illustrates various valid Pull Request titles adhering to the specified format, including examples with Jira ticket references and specific part names. ```Git fix(CMSIS): Rename TRIMSIR registers for MAX32670 and MAX32675 ``` ```Git fix(Third-Party): Remove USB DMA support for MAX32655, MAX32665, MAX32690, MAX78000, and MAX78002 ``` ```Git feat(Examples): Add console output in Hello_World READMEs for all parts ``` ```Git fix(Examples,PeriphDrivers): Deprecate MXC_RTC_GetSecond and MXC_RTC_GetSubSecond for all parts except for MAX32520 ``` ```Git fix(CMSIS): MSDK-123: Add missing I2C Target registers for MAX32670, MAX32672, and MAX32675 ``` ```Git fix(PeriphDrivers): Ticket-321: Fix SPI hanging on 9-bit wide messages for all parts ``` ```Git fix(Documentation): Issue #123: Revise steps for MSDK installation in the user guides ``` -------------------------------- ### Install macOS Dependencies via Homebrew Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Installs necessary dependencies for OpenOCD on macOS using Homebrew, which are required for proper SDK functionality. ```bash brew install libusb-compat libftdi hidapi libusb ``` -------------------------------- ### MSDK Command Line Interface Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats Provides a reference for commands available in the MSDK CLI for device interaction and configuration. ```APIDOC help Displays the available commands. echo (on|off) Enables or disables the input echo. On by default. btn (ID) (s|m|l|x) Simulates button presses. Parameters: ID: The identifier of the button (e.g., 1, 2). s: Short press (less than 200 ms). m: Medium press (between 200 and 500 ms). l: Long press (between 500 and 1000 ms). x: Extra long press (greater than 1000 ms). Example: "btn 1 s" for a short button press on button 1. pin (ConnID) (Pin Code) Used to input the pairing pin code for a specific connection. Parameters: ConnID: The connection identifier. Pin Code: The PIN code for pairing. ``` -------------------------------- ### Simple Message Passing Simulation Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats Demonstrates a simple message passing scenario to a peer device using button presses and system events. ```text btn 2 l Long Button 2 Press > Datc got evt 10 Datc got evt 13 hello back ``` -------------------------------- ### Expected Build Output Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Example output from the `make` command, showing the compilation and linking stages for various source files and the final executable size. ```text Loaded project.mk CC main.c CC /home/msdk/Libraries/Boards/MAX78002/EvKit_V1/Source/board.c CC /home/msdk/Libraries/Boards/MAX78002/EvKit_V1/../../../MiscDrivers/stdio.c CC /home/msdk/Libraries/Boards/MAX78002/EvKit_V1/../../../MiscDrivers/LED/led.c CC /home/msdk/Libraries/Boards/MAX78002/EvKit_V1/../../../MiscDrivers/PushButton/pb.c CC /home/msdk/Libraries/Boards/MAX78002/EvKit_V1/../../../MiscDrivers/Display/adafruit_3315_tft.c CC /home/msdk/Libraries/Boards/MAX78002/EvKit_V1/../../../MiscDrivers/Touchscreen/adafruit_3315_touch.c CC /home/msdk/Libraries/Boards/MAX78002/EvKit_V1/../../../MiscDrivers/Camera/camera.c CC /home/msdk/Libraries/Boards/MAX78002/EvKit_V1/../../../MiscDrivers/Camera/mipi_camera.c CC /home/msdk/Libraries/Boards/MAX78002/EvKit_V1/../../../MiscDrivers/Camera/ov7692.c CC /home/msdk/Libraries/Boards/MAX78002/EvKit_V1/../../../MiscDrivers/Camera/sccb.c AS /home/msdk/Libraries/CMSIS/Device/Maxim/MAX78002/Source/GCC/startup_max78002.S CC /home/msdk/Libraries/CMSIS/Device/Maxim/MAX78002/Source/heap.c CC /home/msdk/Libraries/CMSIS/Device/Maxim/MAX78002/Source/system_max78002.c LD /home/msdk/Examples/MAX78002/Hello_World/build/max78002.elf arm-none-eabi-size --format=berkeley /home/msdk/Examples/MAX78002/Hello_World/build/max78002.elf text data bss dec hex filename 35708 2504 1156 39368 99c8 /home/msdk/Examples/MAX78002/Hello_World/build/max78002.elf ``` -------------------------------- ### MAX32655 ARM Core 2048 Game Example Source: https://analogdevicesinc.github.io/msdk/USERGUIDE This example showcases the ARM Core portion of the 2048 Game for the MAX32655 microcontroller. It demonstrates game logic and ARM architecture integration. ```ARM Examples/MAX32655/Demo_2048/ARM ``` -------------------------------- ### MCS Application Startup Log Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_mcs Logs showing the initial startup sequence of the MCS application, including advertising setup and database hash calculation. ```terminal terminal: init McsAppHandlerInit Calculating database hash McsApp got evt 119 McsApp got evt 32 >>> Reset complete <<< dmAdvActConfig: state: 0 dmAdvActSetData: state: 0 dmAdvActSetData: state: 0 dmAdvActStart: state: 0 HCI_LE_ADV_ENABLE_CMD_CMPL_CBACK_EVT: state: 3 dmDevPassEvtToDevPriv: event: 12, param: 33, advHandle: 0 McsApp got evt 33 >>> Advertising started <<< Database hash calculation complete McsApp got evt 21 Database hash updated ``` -------------------------------- ### MAX32655 RISCV Core 2048 Game Example Source: https://analogdevicesinc.github.io/msdk/USERGUIDE This example showcases the RISCV Core portion of the 2048 Game for the MAX32655 microcontroller. It illustrates game logic and RISCV architecture integration. ```RISCV Examples/MAX32655/Demo_2048/RISCV ``` -------------------------------- ### Initialize CLI Library Source: https://analogdevicesinc.github.io/msdk/Libraries/CLI Call `MXC_CLI_Init` during application startup, passing the UART instance, the command table, and the number of commands. ```c MXC_CLI_Init(uart_instance, user_commands, num_commands); ``` -------------------------------- ### clang-format diff example Source: https://analogdevicesinc.github.io/msdk/CONTRIBUTING Shows the difference between the original file and the version after applying clang-format. This is useful for reviewing changes before committing. ```shell $ diff --git a/Examples/MAX78000/CRC/main.c b/Examples/MAX78000/CRC/main.c index 1dda1feed..c16ceb962 100644 --- a/Examples/MAX78000/CRC/main.c +++ b/Examples/MAX78000/CRC/main.c @@ -83,7 +83,9 @@ void Test_CRC(int asynchronous) printf(asynchronous ? "TEST CRC ASYNC\n" : "TEST CRC SYNC\n"); - for (i = 0; i < DATA_LENGTH; i++) { array[i] = i; } + for (i = 0; i < DATA_LENGTH; i++) { + array[i] = i; + } ``` -------------------------------- ### Startup Output Log Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_FreeRTOS Displays the expected console output when the MAX32655 BLE FreeRTOS demo application starts up. ```log -=- MAX32655 BLE FreeRTOS (V10.2.0) Demo -=- SystemCoreClock = 100000000 terminal: init 32kHz trimed to 0x16 DatsHandlerInit Calculating database hash Dats got evt 119 Dats got evt 32 >>> Reset complete <<< dmAdvActConfig: state: 0 dmAdvActSetData: state: 0 dmAdvActSetData: state: 0 dmAdvActStart: state: 0 HCI_LE_ADV_ENABLE_CMD_CMPL_CBACK_EVT: state: 3 dmDevPassEvtToDevPriv: event: 12, param: 33, advHandle: 0 Dats got evt 33 >>> Advertising started <<< Database hash calculation complete Dats got evt 21 Database hash updated ``` -------------------------------- ### PHY Change Request Simulation (2 MBit) Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats Shows a simulation of requesting a PHY change to 2 MBit for TX and RX, including system event logs. ```text btn 1 x XL Button 1 Press 2 MBit TX and RX PHY Requested > Datc got evt 70 DM_PHY_UPDATE_IND - RX: 2, TX: 2 Datc got evt 65 ``` -------------------------------- ### WSF Timer Management and Callback Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/CORDIO_USERGUIDE Defines and manages timers for scheduling events. Includes setting up timer callbacks, initializing timer handlers, and starting timers with specified delays. ```c wsfHandlerId_t myTimerHandlerId; wsfTimer_t myTimer; ``` ```c //this is the callback to the timer void myTimerHandlerCB(wsfEventMask_t event, wsfMsgHdr_t *pMsg) { uint32_t delayStart_ms = 500; //do stuff //kick off timer again WsfTimerStartMs(&myTimer, delayStart_ms); } ``` ```c //some where you have to set up the timer /* Setup the erase handler */ myTimerHandlerId = WsfOsSetNextHandler(myTimerHandlerCB); myTimer.handlerId = myTimerHandlerId; // somewhere you have to start the timer WsfTimerStartMs(&myTimer, 100); ``` -------------------------------- ### Enable CLI Library in project.mk Source: https://analogdevicesinc.github.io/msdk/Libraries/CLI To enable the CLI library for your project, add the `LIB_CLI = 1` build configuration variable to your `project.mk` file. ```makefile LIB_CLI = 1 ``` -------------------------------- ### BLE_fit Startup Terminal Output Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_fit Displays the expected terminal output when the BLE_fit application starts up, including initialization messages and advertising status. ```terminal terminal: init 32kHz trimmed to 0xF FitHandlerInit Calculating database hash Fit got evt 32 >>> Reset complete <<< dmAdvActConfig: state: 0 dmAdvActSetData: state: 0 dmAdvActSetData: state: 0 dmAdvActStart: state: 0 HCI_LE_ADV_ENABLE_CMD_CMPL_CBACK_EVT: state: 3 dmDevPassEvtToDevPriv: event: 12, param: 33, advHandle: 0 Fit got evt 33 >>> Advertising started <<< Database hash calculation complete Fit got evt 21 Database hash updated Fit got evt 52 ``` -------------------------------- ### Device Startup Log Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_otac_otas Logs detailing the device initialization sequence upon startup, including system status, handler initialization, and advertising start. ```terminal terminal: init 32kHz trimmed to 0x18 DatsHandlerInit WDXS: WdxsHandlerInit FW_VERSION: 1.0 File Hdl: 1 Dats got evt 32 >>> Reset complete <<< dmAdvActConfig: state: 0 dmAdvActSetData: state: 0 dmAdvActSetData: state: 0 dmAdvActStart: state: 0 HCI_LE_ADV_ENABLE_CMD_CMPL_CBACK_EVT: state: 3 dmDevPassEvtToDevPriv: event: 12, param: 33, advHandle: 0 Dats got evt 33 >>> Advertising started <<< ``` -------------------------------- ### Server Found and Connection Log Output Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats Details the logs generated when a target server is found during scanning, followed by the process of stopping the scan and initiating a connection. It covers connection allocation and state transitions. ```log Scan Report: 00:18:80:04:52:1F Name: DATS dmDevPassEvtToDevPriv: event: 13, param: 37, advHandle: 0 Datc got evt 37 Scan results: 4 dmConnIdByBdAddr not found dmConnCcbAlloc 1 >>> Scanning stopped <<< dmConnSmExecute event=24 state=0 dmDevPassEvtToDevPriv: event: 14, param: 0, advHandle: 0 dmConnSmExecute event=28 state=1 dmDevPassEvtToDevPriv: event: 12, param: 39, advHandle: 0 smpDbGetRecord: connId: 1 type: 0 smpDbAddDevice SmpDbGetFailureCount: connId: 1 count: 0 smpDbGetRecord: connId: 1 type: 0 smpDbAddDevice SmpDbGetPairingDisabledTime: connId: 1 period: 0 attemptMult: 0 Datc got evt 39 >>> Connection opened <<< smpSmExecute event=1 state=0 connId=1 idleMask=0x0001 Datc got evt 65 Datc got evt 22 smpSmExecute event=6 state=1 smpSmExecute event=17 state=2 smpSmExecute event=4 state=3 connId=1 idleMask=0x0001 Datc got evt 87 Datc got evt 4 connId=1 idleMask=0x0009 smpSmExecute event=6 state=4 smpSmExecute event=20 state=5 Datc got evt 46 >>> Prompt user to enter passkey <<< Datc got evt 3 AttcDiscServiceCmpl status 0x00 Datc got evt 4 AttcDiscCharCmpl status 0x79 Datc got evt 4 AttcDiscCharCmpl status 0x79 Datc got evt 2 AttcDiscCharCmpl status 0x00 connId=1 idleMask=0x0009 Datc got evt 3 AttcDiscServiceCmpl status 0x00 Datc got evt 4 AttcDiscCharCmpl status 0x79 Datc got evt 4 AttcDiscCharCmpl status 0x00 connId=1 idleMask=0x0009 Datc got evt 3 AttcDiscServiceCmpl status 0x00 Datc got evt 4 AttcDiscCharCmpl status 0x79 Datc got evt 4 AttcDiscCharCmpl status 0x00 connId=1 idleMask=0x0009 Datc got evt 3 AttcDiscServiceCmpl status 0x00 Datc got evt 4 AttcDiscCharCmpl status 0x79 Datc got evt 4 AttcDiscCharCmpl status 0x79 Datc got evt 2 AttcDiscCharCmpl status 0x00 connId=1 idleMask=0x0009 Datc got evt 3 AttcDiscServiceCmpl status 0x00 Datc got evt 4 AttcDiscCharCmpl status 0x79 Datc got evt 4 AttcDiscCharCmpl status 0x79 Datc got evt 2 AttcDiscCharCmpl status 0x79 Datc got evt 2 AttcDiscCharCmpl status 0x00 connId=1 idleMask=0x0001 AppDiscComplete connId:1 status:0x04 connId=1 idleMask=0x0009 Datc got evt 9 AttcDiscConfigCmpl status 0x79 Datc got evt 9 AttcDiscConfigCmpl status 0x79 Datc got evt 9 AttcDiscConfigCmpl status 0x79 Datc got evt 9 AttcDiscConfigCmpl status 0x00 connId=1 idleMask=0x0001 AppDiscComplete connId:1 status:0x08 ``` -------------------------------- ### Connection Attempt Logs: Establishing Link Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats Logs detailing the process when a client attempts to connect to the device, including connection ID allocation, state transitions, and successful connection opening. ```terminal Dats got evt 21 Database hash updated Dats got evt 153 dmConnIdByBdAddr not found dmConnCcbAlloc 1 dmConnSmExecute event=28 state=0 dmAdvConnected: state: 1 dmDevPassEvtToDevPriv: event: 13, param: 34, advHandle: 0 smpDbGetRecord: connId: 1 type: 0 smpDbAddDevice SmpDbGetFailureCount: connId: 1 count: 0 smpDbGetRecord: connId: 1 type: 0 smpDbAddDevice SmpDbGetPairingDisabledTime: connId: 1 period: 0 attemptMult: 0 Dats got evt 39 >>> Connection opened <<< Dats got evt 65 Dats got evt 22 smpSmExecute event=6 state=0 connId=1 idleMask=0x0001 Dats got evt 49 smpSmExecute event=2 state=2 smpSmExecute event=17 state=3 smpSmExecute event=4 state=5 smpSmExecute event=6 state=4 smpSmExecute event=20 state=6 connId=1 idleMask=0x0001 Dats got evt 46 >>> Prompt user to enter passkey <<< Dats got evt 87 connId=1 idleMask=0x0005 connId=1 idleMask=0x0005 connId=1 idleMask=0x0005 connId=1 idleMask=0x0005 connId=1 idleMask=0x0005 connId=1 idleMask=0x0005 connId=1 idleMask=0x0005 connId=1 idleMask=0x0005 ``` -------------------------------- ### PHY Change Request Simulation (1 MBit) Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats Shows a simulation of requesting a PHY change back to 1 MBit for TX and RX, including system event logs. ```text btn 1 x XL Button 1 Press 1 MBit TX and RX PHY Requested > Datc got evt 70 DM_PHY_UPDATE_IND - RX: 1, TX: 1 Datc got evt 65 ``` -------------------------------- ### Expected OpenOCD Flashing Output Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Example output from the `make flash.openocd` command, detailing the OpenOCD server initialization, target connection, and successful communication with the microcontroller. ```text Open On-Chip Debugger 0.11.0+dev-g4cdaa275b (2022-03-02-09:57) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html DEPRECATED! use 'adapter driver' not 'interface' Info : CMSIS-DAP: SWD supported Info : CMSIS-DAP: Atomic commands supported Info : CMSIS-DAP: Test domain timer supported Info : CMSIS-DAP: FW Version = 0256 Info : CMSIS-DAP: Serial# = 044417016af50c6500000000000000000000000097969906 Info : CMSIS-DAP: Interface Initialised (SWD) Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 2000 kHz Info : SWD DPIDR 0x2ba01477 Info : max32xxx.cpu: Cortex-M4 r0p1 processor detected Info : max32xxx.cpu: target has 6 breakpoints, 4 watchpoints Info : starting gdb server for max32xxx.cpu on 3333 Info : Listening on port 3333 for gdb connections Info : SWD DPIDR 0x2ba01477 target halted due to debug-request, current mode: Thread xPSR: 0x81000000 pc: 0x0000fff4 msp: 0x20003ff0 ``` -------------------------------- ### HCI Reset Command Example Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/CORDIO_USERGUIDE Illustrates the structure of a standard HCI command, specifically the RESET command, showing OGF, OCF, parameters, and the final byte sequence in little-endian format. ```APIDOC HCI Reset Command Example: RESET | OGF | OCF | Parameters | | --- | --- | --- | | 0x3 | 0x3 | Length = 0 | Command Byte Sequence: Type = 0x1 Opcode = (0x3 << 10) | 0x3 = 0x0C03 Parameters = 0 Command = {0x1, 0x03, 0x0C, 0x00} (Little Endian) ``` -------------------------------- ### PHY Change Request Simulation (LE Coded S2) Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats Demonstrates requesting a PHY change to LE Coded S2 for TX and RX, logging system events. ```text btn 1 x XL Button 1 Press LE Coded S2 TX and RX PHY Requested > Datc got evt 70 DM_PHY_UPDATE_IND - RX: 3, TX: 3 Datc got evt 65 ``` -------------------------------- ### MSDK Startup Functions (C) Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Demonstrates weak function implementations for early initialization (PreInit), board setup (Board_Init), and system configuration (SystemInit) in the MSDK startup code. These functions can be overridden by the application for custom board integration. ```c /* This function is called before C runtime initialization and can be * implemented by the application for early initializations. If a value other * than '0' is returned, the C runtime initialization will be skipped. * * You may over-ride this function in your program by defining a custom * PreInit(), but care should be taken to reproduce the initialization steps * or a non-functional system may result. */ __weak int PreInit(void) { /* Do nothing */ return 0; } /* This function can be implemented by the application to initialize the board */ __weak int Board_Init(void) { /* Do nothing */ return 0; } /* This function is called just before control is transferred to main(). * * You may over-ride this function in your program by defining a custom * SystemInit(), but care should be taken to reproduce the initialization * steps or a non-functional system may result. */ __weak void SystemInit(void) { /* Configure the interrupt controller to use the application vector table in */ /* the application space */ #if defined(__CC_ARM) || defined(__GNUC__) /* IAR sets the VTOR pointer incorrectly and causes stack corruption */ SCB->VTOR = (uint32_t)__isr_vector; #endif /* __CC_ARM || __GNUC__ */ /* Enable instruction cache */ MXC_ICC_Enable(MXC_ICC0); /* Enable FPU on Cortex-M4, which occupies coprocessor slots 10 and 11 */ /* Grant full access, per "Table B3-24 CPACR bit assignments". */ /* DDI0403D "ARMv7-M Architecture Reference Manual" */ SCB->CPACR |= SCB_CPACR_CP10_Msk | SCB_CPACR_CP11_Msk; __DSB(); __ISB(); SystemCoreClockUpdate(); Board_Init(); } ``` -------------------------------- ### Preview MSDK Documentation Site Source: https://analogdevicesinc.github.io/msdk/CONTRIBUTING Starts a local development server with live reloading to preview the generated static documentation site. This command is part of the Mkdocs toolchain. ```shell mkdocs serve ``` -------------------------------- ### APIDOC: Get Test Stats Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/CORDIO_USERGUIDE Retrieves statistics related to received and transmitted data, including packet counts, CRC errors, and timeouts. Also includes setup watermark values for RX/TX ISR and packet processing. ```APIDOC APIDOC: Get Test Stats Description: Retrieves statistics related to received and transmitted data, including packet counts, CRC errors, and timeouts. Also includes setup watermark values for RX/TX ISR and packet processing. Return (Get Test Stats): RX Data (4 Bytes): Number of successfully received data packets (0x00 - 0xFFFFFFFF) RX Data CRC (4 Bytes): Number of received data packets with CRC errors (0x00 - 0xFFFFFFFF) RX Data Timeout (4 Bytes): Number of timed out data packets (receive timeout) (0x00 - 0xFFFFFFFF) TX Data (4 Bytes): Number of sent data packets (0x00 - 0xFFFFFFFF) Err Data (4 Bytes): Number of data transaction errors (0x00 - 0xFFFFFFFF) RX Setup (2 Bytes): RX packet setup watermark in microseconds (0x00 - 0xFFFF) TX Setup (2 Bytes): TX packet setup watermark in microseconds (0x00 - 0xFFFF) RX ISR (2 Bytes): RX ISR processing watermark in microseconds (0x00 - 0xFFFF) TX ISR (2 Bytes): TX ISR processing watermark in microseconds (0x00 - 0xFFFF) ``` -------------------------------- ### Source MSDK Environment Setup Script Source: https://analogdevicesinc.github.io/msdk/USERGUIDE This command sources the setenv.sh script to configure the development environment for MSDK projects on Linux/macOS. It can be added to shell startup scripts for automation. ```bash source ~/MaximSDK/setenv.sh ``` -------------------------------- ### Get ISO Connection Statistics API Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/CORDIO_USERGUIDE Retrieves statistics related to ISO (Connectionless) data transfers. This includes counts for received and sent packets, CRC errors, timeouts, and transaction errors, as well as setup and ISR processing watermarks. ```APIDOC APIDOC: Get ISO Connection Statistics: Description: Returns statistics for ISO data connections. Return Structure: RX Data (4 Bytes): Number of successfully received data packets (0x00 - 0xFFFFFFFF). RX Data CRC (4 Bytes): Number of received data packets with CRC errors (0x00 - 0xFFFFFFFF). RX Data Timeout (4 Bytes): Number of timed out data packets (receive timeout) (0x00 - 0xFFFFFFFF). TX Data (4 Bytes): Number of sent data packets (0x00 - 0xFFFFFFFF). Err Data (4 Bytes): Number of data transaction errors (0x00 - 0xFFFFFFFF). RX Setup (2 Bytes): RX packet setup watermark in microseconds (0x00 - 0xFFFF). TX Setup (2 Bytes): TX packet setup watermark in microseconds (0x00 - 0xFFFF). RX ISR (2 Bytes): RX ISR processing watermark in microseconds (0x00 - 0xFFFF). TX ISR (2 Bytes): TX ISR processing watermark in microseconds (0x00 - 0xFFFF). ``` -------------------------------- ### Get Auxiliary Advertising Statistics API Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/CORDIO_USERGUIDE Retrieves accumulated statistics for auxiliary advertising operations. This command returns counts for sent advertising packets, received advertising requests, CRC errors, timeouts, sent responses, sent chain packets, and advertising transaction errors, along with setup and ISR watermarks. ```APIDOC APIDOC: Get Auxiliary Advertising Statistics: Packet type: Command Packet OGF: 0x3F OCF: 0x3DA Param. Length (bytes): 0 Parameters: N/A Return: {TX ADV, RX Req, RX Req CRC, RX Req Timeout, TX RSP, TX Chain, Err ADV, RX Setup, TX Setup, RX ISR, TX ISR} Return Details: TX ADV (4 Bytes): Number of sent advertising packets (0x00 – 0xFFFFFFFF). RX Req (4 Bytes): Number of successfully received advertising requests (0x00 – 0xFFFFFFFF). RX Req CRC (4 Bytes): Number of received advertising requests with CRC errors (0x00 – 0xFFFFFFFF). RX Req Timeout (4 Bytes): Number of timed out received advertising requests (receive timeout) (0x00 – 0xFFFFFFFF). TX RSP (4 Bytes): Number of sent response packets (0x00 – 0xFFFFFFFF). TX Chain (4 Bytes): Number of sent chain packets (0x00 – 0xFFFFFFFF). Err ADV (4 Bytes): Number of advertising transaction errors (0x00 – 0xFFFFFFFF). RX Setup (2 Bytes): RX packet setup watermark in microseconds (0x00 – 0xFFFF). TX Setup (2 Bytes): TX packet setup watermark in microseconds (0x00 – 0xFFFF). RX ISR (2 Bytes): RX ISR processing watermark in microseconds (0x00 – 0xFFFF). TX ISR (2 Bytes): TX ISR processing watermark in microseconds (0x00 – 0xFFFF). ``` -------------------------------- ### Build MSDK Documentation Locally Source: https://analogdevicesinc.github.io/msdk/CONTRIBUTING Executes the Python script to build all Peripheral API references using Doxygen, copy markdown files, and then build the MSDK User Guide using Mkdocs. The output is placed in the 'docs' folder. ```shell python Documentation/build.py ``` -------------------------------- ### Manual MSDK Environment Setup (Linux/macOS) Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Provides manual environment variable configurations for Linux and macOS to set up the MSDK development environment. This includes setting the MSDK path and adding toolchains to the system's PATH. ```bash # Set MAXIM_PATH to point to the MSDK export MAXIM_PATH=#changeme! # Add Arm Embedded GCC to path (v10.3) export ARM_GCC_ROOT=$MAXIM_PATH/Tools/GNUTools/10.3 export PATH=$ARM_GCC_ROOT/bin:$PATH # Add xPack RISC-V GCC to path (v12.2) export XPACK_GCC_ROOT=$MAXIM_PATH/Tools/xPack/riscv-none-elf-gcc/12.2.0-3.1 export PATH=$XPACK_GCC_ROOT/bin:$PATH # Add OpenOCD to path export OPENOCD_ROOT=$MAXIM_PATH/Tools/OpenOCD export PATH=$OPENOCD_ROOT:$PATH ``` ```bash # Set MAXIM_PATH environment variable export MAXIM_PATH=$HOME/MaximSDK ``` -------------------------------- ### LED Indicators Source: https://analogdevicesinc.github.io/msdk/Libraries/Cordio/docs/Applications/BLE_datc_dats Description of LED behavior for indicating system status in the BLE data examples. The red LED signals errors, and the green LED indicates CPU activity. ```APIDOC LEDs: Red LED: Indicates that an error assertion has occurred. Green LED: Indicates CPU activity. When the LED is on, the CPU is active; when the LED is off, the CPU is in sleep mode. ``` -------------------------------- ### Build MSDK Project (Command-Line) Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Compile your MSDK project from the command line. Navigate to the project directory and execute the 'make' command. Parallel builds are supported for faster compilation. ```bash cd make ``` ```bash # Parallel Build (fastest build, but console message formatting may be mangled): make -r -j ``` ```bash # Serial Build: make -r ``` -------------------------------- ### Change Installation Folder Ownership (Linux/macOS) Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Changes the ownership of the MSDK installation folder to the current user on Linux or macOS to prevent file permission issues with the toolchain. ```bash sudo chown -R $(whoami):$(whoami) ``` -------------------------------- ### MAX32655 I2C EEPROM Communication Example Source: https://analogdevicesinc.github.io/msdk/USERGUIDE This example showcases I2C communication with a 24LC256 EEPROM using the MAX32655. It demonstrates how to interface with I2C peripherals for data storage. ```C Examples/MAX32655/I2C_EEPROM ``` -------------------------------- ### Custom Board Initialization Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Example of implementing a custom Board_Init function within a project's main.c file when BSP integration is disabled (LIB_BOARD = 0). This allows for custom system initialization without a separate BSP folder. ```c // main.c int Board_Init(void) { // Implement me! return E_NO_ERROR; } int main(void) { Board_Init(); // ... } ``` -------------------------------- ### MAX32655 External Flash Memory Example Source: https://analogdevicesinc.github.io/msdk/USERGUIDE This example demonstrates the usage of external flash memory with the MAX32655 microcontroller. It covers reading from and writing to external flash storage. ```C Examples/MAX32655/External_Flash ``` -------------------------------- ### Setting Build Variables via Command Line/Environment Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Demonstrates how to set build configuration variables like MFLOAT_ABI using the 'make' command or environment variables. This allows for flexible build customization. ```make MFLOAT_ABI=hard # Example usage on command line: make MFLOAT_ABI=hard # Example usage via environment variable (Linux): export MFLOAT_ABI=hard ``` -------------------------------- ### Add Simple Library Sources to Build Source: https://analogdevicesinc.github.io/msdk/CONTRIBUTING Makefile example for including simple libraries by adding include paths (`IPATH`) and source directories (`VPATH`). Source files (`SRCS`) are then listed for compilation. ```makefile IPATH += $(LIBRARY_NAME_DIR)/include VPATH += $(LIBRARY_NAME_DIR)/src SRCS += libfile1.c SRCS += libfile2.c ``` -------------------------------- ### Custom BSP File Structure and Configuration Source: https://analogdevicesinc.github.io/msdk/USERGUIDE Illustrates the recommended directory structure for a custom BSP, highlighting the required 'board.mk' file and optional 'Include' and 'Source' directories. It also shows how to select a custom BSP using the BOARD build configuration variable. ```text CustomBSP (defines BOARD value) ├─ board.mk (required file!) ├─ Include | └─ board.h └─ Source └─ board.c BOARD = CustomBSP ``` -------------------------------- ### Run MSDKGen Utility Source: https://analogdevicesinc.github.io/msdk/CONTRIBUTING Command to update MSDK example project support files using the MSDKGen utility. Specify your project name and use `--overwrite` to replace existing files. ```bash python msdkgen.py update-all --projects yourprojectname --overwrite ```