### Run wolfSSL Example Server Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/FreeRTOS-Plus/ThirdParty/wolfSSL/IDE/VS-AZURE-SPHERE/README.md Command to start the wolfSSL example server, binding to any interface and disabling client certificate checks. ```bash ./examples/server/server -b -d -p 11111 -c ./certs/server-cert.pem -k ./certs/server-key.pem ``` -------------------------------- ### GDB Debugging Setup Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Echo_Qemu_mps2/Readme.md Start QEMU with -s and -S, then connect GDB to port 1234. Set breakpoints and continue execution. ```bash $ arm-none-eabi-gdb -q ./build/RTOSDemo.axf (gdb) target remote :1234 (gdb) break main (gdb) c ``` -------------------------------- ### Get MSDK Installer Help Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Run the MSDK installer with the --help option to view available commands and options for command-line operations. ```shell $ ./MaximMicrosSDK_linux.run --help ``` -------------------------------- ### Project Setup and Source Inclusion Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/tinyusb/examples/device/audio_4_channel_mic_freertos/CMakeLists.txt Configures the project name, includes family support, and adds source files for the FreeRTOS audio example. ```cmake cmake_minimum_required(VERSION 3.17) include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake) # gets PROJECT name for the example (e.g. -) family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR}) project(${PROJECT} C CXX ASM) # Checks this example is valid for the family and initializes the project family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}) # Espressif has its own cmake build system if(FAMILY STREQUAL "espressif") return() endif() add_executable(${PROJECT}) # Example source target_sources(${PROJECT} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/freertos_hook.c ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c ) # Example include target_include_directories(${PROJECT} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ) # Add libm for GCC if (CMAKE_C_COMPILER_ID STREQUAL "GNU") target_link_libraries(${PROJECT} PUBLIC m) endif() # Configure compilation flags and libraries for the example with FreeRTOS. # See the corresponding function in hw/bsp/FAMILY/family.cmake for details. family_configure_device_example(${PROJECT} freertos) ``` -------------------------------- ### Build Example Project Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Use the 'make' command to build an example project. Ensure you are in the project's directory. For faster builds, consider using parallel execution with specific options. ```shell make ``` ```shell make -r -j --output-sync=target --no-print-directory ``` -------------------------------- ### Project Setup and Initialization Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/tinyusb/examples/device/midi_test/CMakeLists.txt Sets the minimum CMake version, includes family support, gets the project name, and initializes the project for the specified family. Includes a specific check to return early for Espressif family. ```cmake cmake_minimum_required(VERSION 3.17) include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake) # gets PROJECT name for the example (e.g. -) family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR}) project(${PROJECT} C CXX ASM) # Checks this example is valid for the family and initializes the project family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}) # Espressif has its own cmake build system if(FAMILY STREQUAL "espressif") return() endif() ``` -------------------------------- ### LittleFS Basic File Operations Example Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/littlefs/Documentation/html/md_littlefs_README.html This example demonstrates mounting, reading, updating, and closing a file named 'boot_count' using LittleFS. It includes reformatting and mounting logic for initial setup. Ensure user-provided block device operations (read, prog, erase, sync) are defined. ```c #include "lfs.h" // variables used by the filesystem lfs_t lfs; lfs_file_t file; // configuration of the filesystem is provided by this struct const struct lfs_config cfg = { // block device operations .read = user_provided_block_device_read, .prog = user_provided_block_device_prog, .erase = user_provided_block_device_erase, .sync = user_provided_block_device_sync, // block device configuration .read_size = 16, .prog_size = 16, .block_size = 4096, .block_count = 128, .cache_size = 16, .lookahead_size = 16, .block_cycles = 500, }; // entry point int main(void) { // mount the filesystem int err = lfs_mount(&lfs, &cfg); // reformat if we can't mount the filesystem // this should only happen on the first boot if (err) { lfs_format(&lfs, &cfg); lfs_mount(&lfs, &cfg); } // read current count uint32_t boot_count = 0; lfs_file_open(&lfs, &file, "boot_count", LFS_O_RDWR | LFS_O_CREAT); lfs_file_read(&lfs, &file, &boot_count, sizeof(boot_count)); // update boot count boot_count += 1; lfs_file_rewind(&lfs, &file); lfs_file_write(&lfs, &file, &boot_count, sizeof(boot_count)); // remember the storage is not updated until the file is closed successfully lfs_file_close(&lfs, &file); // release any resources we were using lfs_unmount(&lfs); // print the boot count printf("boot_count: %d\n", boot_count); } ``` -------------------------------- ### Wear Leveling Example Initialization and Command Loop Source: https://github.com/analogdevicesinc/msdk/blob/main/Examples/MAX32672/WearLeveling/README.md This snippet shows the initial setup of the LittleFS filesystem, including formatting if invalid, and then enters a command loop to process user input for various file operations and wear leveling tests. It handles the 'help', 'stop', 'read', 'write', and 'swl' commands. ```c int main(void) { int retVal; uint32_t block; uint32_t writes; lfs_t *lfs; lfs = lfs_init(); if (lfs == NULL) { return 1; } printf("********** Wear Leveling Example ********** "); // Mount the filesystem printf("Mounting the filesystem... "); retVal = mount_lfs(lfs); if (retVal != LFS_OK) { printf("Filesystem is invalid, formatting... "); retVal = format_lfs(lfs); if (retVal != LFS_OK) { printf("Error formatting filesystem: %d ", retVal); return 1; } retVal = mount_lfs(lfs); if (retVal != LFS_OK) { printf("Error mounting filesystem after format: %d ", retVal); return 1; } } printf("Filesystem is mounted! Ready for commands. "); // Command loop while (1) { char *cmd_str; cmd_str = get_command(); if (cmd_str == NULL) { continue; } if (strncmp(cmd_str, "help", 4) == 0) { print_help(); } else if (strncmp(cmd_str, "stop", 4) == 0) { break; } else if (strncmp(cmd_str, "read", 4) == 0) { read_file(lfs, cmd_str); } else if (strncmp(cmd_str, "write", 5) == 0) { write_file(lfs, cmd_str); } else if (strncmp(cmd_str, "swl", 3) == 0) { // Get number of writes from command string char *num_writes_str = strtok(cmd_str, " "); num_writes_str = strtok(NULL, " "); writes = (uint32_t)atoi(num_writes_str); printf("Performing %d writes to test file... ", writes); for (block = 0; block < NUM_LFS_BLOCKS; block++) { lfs_block_program(lfs, block, 0); } printf("All writes have completed. Here are the results: "); for (block = 0; block < NUM_LFS_BLOCKS; block++) { printf("Block %d was written to %d times. ", block, lfs_block_reads(lfs, block)); } } else { printf("Unknown command: %s ", cmd_str); } } // Release filesystem resources printf("Filesystem resources released. "); lfs_unmount(lfs); printf("Example complete! "); return 0; } ``` -------------------------------- ### Secure Boot Tools Link Example Source: https://github.com/analogdevicesinc/msdk/blob/main/Documentation/MAX32675.html Example of using the addLink function to check for Secure Boot Tools installation. This snippet dynamically creates a link or displays an error message in the specified DOM element. ```javascript addLink('../Tools/SBT/docs/blank.bmp', '../Tools/SBT/docs/UG7236Rev1_MaximSDK_Secure_Boot_Tool_User_Guide.pdf', 'Secure Boot Tools', 'The secure boot tools have not been installed.', document.getElementById('sbt') ); ``` -------------------------------- ### Dynamically Create Documentation Links Source: https://github.com/analogdevicesinc/msdk/blob/main/Documentation/MAX32690.html This JavaScript function creates links to documentation or installation guides. It checks for the existence of a test file and updates the DOM accordingly. Use this to provide users with direct links to installed documentation or messages indicating missing installations. ```javascript function addLink(testFile, url, passText, failText, dom) { var img = new Image(); img.onerror = function() { dom.innerHTML += failText; }; img.onload = function() { dom.innerHTML += '' + passText + ''; }; img.src = testFile; console.log('Test'); console.log(img.currentSrc); } ``` -------------------------------- ### Example Build Output Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md This is the expected output when compiling an example project, showing the compilation and linking steps. ```bash 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 ``` -------------------------------- ### Install Ubuntu GUI Packages Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Run this command before executing the MSDK installer on Ubuntu to install required GUI packages for the QT installer framework. ```shell 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 ``` -------------------------------- ### Manual MSDK Environment Setup (Linux/MacOS) Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Manually configure your environment for MSDK development by exporting environment variables in your shell's startup script. Ensure MAXIM_PATH is set to your MSDK installation location. ```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 ``` -------------------------------- ### Install MSDK on Linux/macOS (CLI) Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Execute the installer with 'sudo' and provide the 'in --root' arguments to specify the installation path on Linux or macOS. ```shell sudo ./MaximMicrosSDK_linux.run in --root ~//MaximSDK ``` -------------------------------- ### Install MSDK on Windows (CLI) Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Use the 'in' command with the --root option to specify the installation directory for a command-line installation on Windows. ```shell .\MaximMicrosSDK_win.exe in --root C:/MaximSDK ``` -------------------------------- ### Verify MaximSDK Installation Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md After installation, use `ls -la` in the `~/MaximSDK` directory to confirm that all expected files and directories are present. This output shows a typical structure. ```shell ls -la ~/MaximSDK total 29656 drwxr-xr-x 8 username username 4096 Jul 13 20:41 . drwxr-x--- 17 username username 4096 Jul 13 20:41 .. drwxr-xr-x 2 username username 4096 Jul 13 20:41 Documentation drwxr-xr-x 15 username username 4096 Jul 13 20:41 Examples -rw-r--r-- 1 username username 171189 Jul 13 20:41 InstallationLog.txt drwxr-xr-x 17 username username 4096 Jun 28 23:42 Libraries drwxr-xr-x 2 username username 4096 Jul 13 20:41 Licenses -rwxr-xr-x 1 username username 28287992 Jul 13 20:41 MaintenanceTool -rw-r--r-- 1 username username 1719694 Jul 13 20:41 MaintenanceTool.dat -rw-r--r-- 1 username username 9770 Jul 13 20:41 MaintenanceTool.ini drwxr-xr-x 11 username username 4096 Jun 28 23:42 Tools -rw-r--r-- 1 username username 13123 Jun 28 23:48 changelog.txt -rw-r--r-- 1 username username 67664 Jul 13 20:41 components.xml -rw-r--r-- 1 username username 48 Jul 13 20:41 installer.dat drwxr-xr-x 112 username username 12288 Jul 13 20:41 installerResources -rw-r--r-- 1 username username 25214 Jun 29 00:47 maxim.ico -rw-r--r-- 1 username username 362 Jul 13 20:41 network.xml -rwxrwxrwx 1 username username 1129 Jun 29 00:47 setenv.sh -rwxrwxrwx 1 username username 300 Jun 29 00:47 updates.sh ``` -------------------------------- ### OpenOCD Output Example Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md This is an example of the expected output when using the `make flash.openocd` command, showing the OpenOCD initialization, programming, verification, and reset process. ```bash 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 ** Programming Started ** ** Programming Finished ** ** Verify Started ** ** Verified OK ** ** Resetting Target ** Info : SWD DPIDR 0x2ba01477 shutdown command invoked ``` -------------------------------- ### Unattended MSDK Installation (Linux/macOS) Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Perform an unattended installation by adding --accept-licenses, --accept-messages, and --confirm-command to the installer arguments. ```shell sudo ./MaximMicrosSDK_linux.run in --root ~//MaximSDK --accept-licenses --accept-messages --confirm-command ``` -------------------------------- ### Basic LVGL Button Example in Berry Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/LVGL/lvgl/docs/get-started/platforms/tasmota-berry.md This snippet demonstrates how to start LVGL, get the default screen, create a button, center it, add a label, and set the label's text using the Berry scripting language. ```python lv.start() # start LVGL scr = lv.scr_act() # get default screen btn = lv.btn(scr) # create button btn.center() label = lv.label(btn) # create a label in the button label.set_text("Button") # set a label to the button ``` -------------------------------- ### Example OpenOCD Flashing Output Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md This is the expected output when flashing an example project using 'make flash.openocd', indicating successful connection and initialization of the debug adapter and target. ```bash 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 ``` -------------------------------- ### Eclipse Installation Check Example Source: https://github.com/analogdevicesinc/msdk/blob/main/Documentation/MAX32675.html Example of using the addLink function to check for Eclipse installation. This snippet dynamically creates a link or displays an error message in the specified DOM element. ```javascript addLink('../Tools/Eclipse/cdt/plugins/org.eclipse.platform_4.13.0.v20190916-1045/splash.bmp', '../Tools/Eclipse/cdt/readme/readme_eclipse.html', 'Eclipse', 'Eclipse has not been installed.', document.getElementById('eclipse') ); ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/tinyusb/examples/device/audio_4_channel_mic_freertos/README.md Change the current directory to the TinyUSB audio example. ```bash cd /tinyusb/examples/device/audio_4_channel_mic_freertos ``` -------------------------------- ### Flash Example Project with OpenOCD Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Execute the 'make flash.openocd' command to flash the built project onto the target hardware using OpenOCD. This command automates the OpenOCD server process for flashing. ```shell make flash.openocd ``` -------------------------------- ### Build Example with Meson Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/FreeRTOS/Test/CMock/CMock/vendor/unity/examples/example_4/readme.txt Command to set up the build directory for the example using Meson. ```bash meson setup ``` -------------------------------- ### Install wolfssl on CentOS Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/FreeRTOS-Plus/ThirdParty/wolfSSL/wrapper/python/wolfcrypt/README.rst Installs the wolfssl library on CentOS, including EPEL repository setup and library path configuration. ```console sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm sudo yum update sudo yum install -y git autoconf libtool git clone git@github.com:wolfssl/wolfssl.git cd wolfssl ./autogen.sh ./configure --enable-sha512 make sudo make install echo /usr/local/lib > wolfssl.conf sudo mv wolfssl.conf /etc/ld.so.conf sudo ldconfig ``` -------------------------------- ### Make Linux Installer Executable Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Before running the MSDK installer on Linux, make the downloaded file executable using chmod. ```shell chmod +x MaximMicrosSDK_linux.run ``` -------------------------------- ### Set MFLOAT_ABI in project.mk Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Set build configuration variables in the project.mk file. This example enables hardware floating-point acceleration. ```Make # 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/ # ********************************************************** MFLOAT_ABI=hard # Enable hardware floating point acceleration ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/tinyusb/examples/device/audio_test_freertos/README.md Change the current directory to the audio_test_freertos example within the TinyUSB library. ```bash cd /tinyusb/examples/device/audio_test_freertos ``` -------------------------------- ### Get Help in GDB Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Access command descriptions using 'help' for general assistance or 'help ' for specific commands. ```gdb help ``` ```gdb help ``` -------------------------------- ### Timer Example Output Source: https://github.com/analogdevicesinc/msdk/blob/main/Examples/MAX78002/TMR/README.md Console output messages indicating the start of PWM and continuous timer functionalities, and confirming the PWM has started. ```text ************************** Timer Example ************************** 1. A oneshot mode timer, Timer 4 (low-power timer) is used to create an interrupt at a freq of 1 Hz. LED2 (P0.3) will toggle when the interrupt occurs. 2. Timer 0 is used to output a PWM signal on Port 0.2. The PWM frequency is 1000 Hz and the duty cycle is 50%. 3. Timer 1 is configured as 16-bit timer used in continuous mode which is used to create an interrupt at freq of 2 Hz. LED1 (P0.2) will toggle when the interrupt occurs. Push PB1 to start the PWM and continuous timer and PB2 to start the oneshot timer. PWM started. Continuous timer started. ``` -------------------------------- ### f_fdisk and f_mkfs Example Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/SDHC/ff14/documents/doc/fdisk.html Initializes a disk drive, divides it into partitions using f_fdisk, and then creates FAT volumes on the new logical drives using f_mkfs. ```c BYTE work[FF_MAX_SS]; /* Working buffer */ LBA_t plist[] = {50, 50, 0}; /* Divide the drive into two partitions */ /* {0x10000000, 100}; 256M sectors for 1st partition and left all for 2nd partition */ /* {20, 20, 20, 0}; 20% for 3 partitions each and remaing space is left not allocated */ _f_fdisk_(0, plist, work); /* Divide physical drive 0 */ f_mkfs("0:", 0, work, sizeof work); /* Create FAT volume on the logical drive 0 */ f_mkfs("1:", 0, work, sizeof work); /* Create FAT volume on the logical drive 1 */ ``` -------------------------------- ### Eclipse: Importing Existing Projects Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Steps to import existing projects into an Eclipse workspace. Ensure 'Copy projects into workspace' is selected to keep original examples unmodified. ```shell File -> Import -> General -> Existing Projects into Workspace ``` -------------------------------- ### Install OpenOCD Dependencies on MacOS Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Installs necessary dependencies for OpenOCD on macOS using Homebrew. Ensure Homebrew is installed before running this command. ```shell brew install libusb-compat libftdi hidapi libusb ``` -------------------------------- ### Get Label Text Selection Start Index Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/LVGL/lvgl/docs/widgets/core/label.md Provides the function to retrieve the starting character index of selected text within a label. ```c lv_label_get_text_selection_start(label, start_char_index); ``` -------------------------------- ### Run wolfSSL Example Server on Host Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/FreeRTOS-Plus/ThirdParty/wolfSSL/IDE/WORKBENCH/README.md Execute the wolfSSL example server on the host machine from the /wolfssl directory using the specified command. ```bash ./examples/server/server -d -b ``` -------------------------------- ### Build Example with CMake and Ninja Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/tinyusb/examples/device/audio_4_channel_mic_freertos/README.md Configure the project using CMake for the 'espressif_s3_devkitc' board and then build the project using Ninja. ```bash cmake -DBOARD=espressif_s3_devkitc -B build -G Ninja . ninja.exe -C build ``` -------------------------------- ### VS Code User Settings Configuration Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Add these entries to your user settings.json file in VS Code. Ensure MAXIM_PATH points to your MSDK installation directory using forward slashes. ```json // There may be other settings up here... "MAXIM_PATH": "Change me! Only use forward slashes (/) for this path", "update.mode": "manual", "extensions.autoUpdate": false, // There may be other settings down here... ``` -------------------------------- ### I2S Transmission Example Output Source: https://github.com/analogdevicesinc/msdk/blob/main/Examples/MAX32670/I2S/README.md This is the expected output from the I2S transmission example. It indicates the start of the example and completion of the I2S transaction. Note the reminder about jumper settings for I2S and UART shared pins. ```text I2S Transmission Example You may need to disconnect RX_SEL (JP3) and TX_SEL (JP4) in case no data is moving in and out of SDO/SDI. I2S Transaction Complete. Ignore any random characters previously displayed. The I2S and UART are sharing the same pins. ``` -------------------------------- ### Initialize Project Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/tinyusb/examples/device/audio_4_channel_mic/CMakeLists.txt Checks if the example is valid for the current family and initializes the project. ```cmake # Checks this example is valid for the family and initializes the project family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}) ``` -------------------------------- ### Verify MSDK Folder Ownership (Linux/macOS) Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Use ls -la to verify the ownership of the MSDK installation directory. Root ownership can lead to toolchain inconsistencies. ```shell ls -la ~/MaximSDK total 29656 drwxr-xr-x 8 root root 4096 Jul 13 20:41 . drwxr-x--- 17 username username 4096 Jul 13 20:41 .. drwxr-xr-x 2 root root 4096 Jul 13 20:41 Documentation drwxr-xr-x 15 root root 4096 Jul 13 20:41 Examples -rw-r--r-- 1 root root 171189 Jul 13 20:41 InstallationLog.txt drwxr-xr-x 17 root root 4096 Jun 28 23:42 Libraries drwxr-xr-x 2 root root 4096 Jul 13 20:41 Licenses -rwxr-xr-x 1 root root 28287992 Jul 13 20:41 MaintenanceTool -rw-r--r-- 1 root root 1719694 Jul 13 20:41 MaintenanceTool.dat -rw-r--r-- 1 root root 9770 Jul 13 20:41 MaintenanceTool.ini drwxr-xr-x 11 root root 4096 Jun 28 23:42 Tools -rw-r--r-- 1 root root 13123 Jun 29 00:47 changelog.txt -rw-r--r-- 1 root root 67664 Jul 13 20:41 components.xml -rw-r--r-- 1 root root 48 Jul 13 20:41 installer.dat drwxr-xr-x 112 root root 12288 Jul 13 20:41 installerResources -rw-r--r-- 1 root root 25214 Jun 29 00:47 maxim.ico -rw-r--r-- 1 root root 362 Jul 13 20:41 network.xml -rwxrwxrwx 1 root root 1129 Jun 29 00:47 setenv.sh -rwxrwxrwx 1 root root 300 Jun 29 00:47 updates.sh ``` -------------------------------- ### Timer Example Console Output Source: https://github.com/analogdevicesinc/msdk/blob/main/Examples/MAX78000/TMR/README.md This is the expected output displayed on the console UART when the timer example is run. It confirms the start and expiration of different timer modes. ```text ************************** Timer Example ************************** 1. A oneshot mode timer, Timer 5 (low-power timer) is used to create an interrupt at a freq of 1 Hz. If running the example on the MAX78000EVKIT, LED2 will toggle when the interrupt occurs. 2. Timer 4 is used to output a PWM signal on P2.4 (labeled "AIN1" on MAX78000FTHR). The PWM frequency is 10 Hz and the duty cycle is 50%. 3. Timer 1 is configured as a 16-bit timer used in continuous mode. It creates an interrupt at freq of 2 Hz. LED1 will toggle when the interrupt occurs. Push PB1 to start the PWM and continuous timers and PB2 to start the oneshot timer. PWM started. Continuous timer started. Oneshot timer started. Oneshot timer expired! ``` -------------------------------- ### Set MFLOAT_ABI as Environment Variable (Linux) Source: https://github.com/analogdevicesinc/msdk/blob/main/USERGUIDE.md Environment variables can be used to set configuration variables. This example sets MFLOAT_ABI as a default for all projects on Linux. ```Shell export MFLOAT_ABI=hard ``` -------------------------------- ### Format Default Drive and Create File with FatFs Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/SDHC/ff14/documents/doc/mkfs.html This example demonstrates formatting the default drive with default parameters and then creating a new file to write data. It includes mounting the filesystem, writing to the file, closing it, and unmounting. ```c int main (void) { FATFS fs; /* Filesystem object */ FIL fil; /* File object */ FRESULT res; /* API result code */ UINT bw; /* Bytes written */ BYTE work[FF_MAX_SS]; /* Work area (larger is better for processing time) */ /* Format the default drive with default parameters */ res = f_mkfs("", 0, work, sizeof work); if (res) ... /* Give a work area to the default drive */ f_mount(&fs, "", 0); /* Create a file as new */ res = f_open(&fil, "hello.txt", FA_CREATE_NEW | FA_WRITE); if (res) ... /* Write a message */ f_write(&fil, "Hello, World!\r\n", 15, &bw); if (bw != 15) ... /* Close the file */ f_close(&fil); /* Unregister work area */ f_mount(0, "", 0); ... ``` -------------------------------- ### Cross Compile Example Setup Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/FreeRTOS-Plus/ThirdParty/wolfSSL/CMakeLists.txt Example configuration for cross-compiling wolfSSL for a Linux ARM target. This includes setting the system name, processor, C/C++ compilers, and sysroot. ```cmake #set(CMAKE_SYSTEM_NAME Linux) #set(CMAKE_SYSTEM_PROCESSOR arm) #set(CMAKE_C_COMPILER "/opt/arm-linux-musleabihf-cross/bin/arm-linux-musleabihf-gcc") #set(CMAKE_CXX_COMPILER "/opt/arm-linux-musleabihf-cross/bin/arm-linux-musleabihf-g++") #set(CMAKE_SYSROOT "/opt/arm-linux-musleabihf-cross/arm-linux-musleabihf/") ``` -------------------------------- ### SPI Master-Slave Example Output Source: https://github.com/analogdevicesinc/msdk/blob/main/Examples/MAX32650/SPI_MasterSlave/README.md Console output indicating the start and success of the SPI master-slave example. It confirms the roles of SPI1 (slave) and SPI2 (master) and the data transfer. ```text ************************ SPI Master-Slave Example ************************ This example sends data between two SPI peripherals in the MAX32650. SPI1 is configured as the slave and SPI2 is configured as the master. Each SPI peripheral sends 1024 bytes on the SPI bus. If the data received by each SPI instance matches the data sent by the other instance, the green LED will illuminate, otherwise the red LED will illuminate. Press SW2 to begin transaction. EXAMPLE SUCCEEDED! ``` -------------------------------- ### MSYS2 Link Example Source: https://github.com/analogdevicesinc/msdk/blob/main/Documentation/MAX32675.html Example of using the addLink function to check for MSYS2 installation. This snippet dynamically creates a link or displays an error message in the specified DOM element. ```javascript addLink('../Tools/MSYS2/msys2.ico', 'https://www.msys2.org/docs/what-is-msys2/', 'MSYS2 (Building Platform for Windows)', 'The MSYS2 package has not been installed.', document.getElementById('mingw') ); ``` -------------------------------- ### Run wolfSSL Example Client on Host Source: https://github.com/analogdevicesinc/msdk/blob/main/Libraries/FreeRTOS-Plus/ThirdParty/wolfSSL/IDE/WORKBENCH/README.md Execute the wolfSSL example client on the host machine from the /wolfssl directory, specifying the server's IP address. ```bash ./examples/client/client -h 192.168.200.1 ``` -------------------------------- ### OpenOCD Link Example Source: https://github.com/analogdevicesinc/msdk/blob/main/Documentation/MAX32675.html Example of using the addLink function to check for OpenOCD installation. This snippet dynamically creates a link or displays an error message in the specified DOM element. ```javascript addLink('../Tools/OpenOCD/blank.bmp', 'http://openocd.org/doc/html/index.html', 'OpenOCD', 'OpenOCD has not been installed.', document.getElementById('openocd') ); ``` -------------------------------- ### Free-RTOS Link Example Source: https://github.com/analogdevicesinc/msdk/blob/main/Documentation/MAX32675.html Example of using the addLink function to check for Free-RTOS installation. This snippet dynamically creates a link or displays an error message in the specified DOM element. ```javascript addLink('../Libraries/FreeRTOS/Documentation/blank.bmp', '../Libraries/FreeRTOS/readme.txt', 'Free-RTOS', 'The Free-RTOS libraries have not been installed.', document.getElementById('free-rtos') ); ```