Skip to content
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

fix(PeriphDrivers): Resize the USN buffer in checksum verification for MAX32655, MAX32662, and MAX32670 #1192

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

crsz20
Copy link
Contributor

@crsz20 crsz20 commented Sep 25, 2024

Description

Error

  • On ME17, the BLE4_ctrl and BLE5_ctrl examples were failing a checksum verification in MXC_SYS_GetUSN() and were unable to finish executing PalCfgLoadData().
  • This error was also found on boards with a similar implementation of MXC_SYS_GetUSN(). Namely, ME12 and ME15.

Solution

  • Change the length of a USN buffer from 13 to 16, which is 4-byte aligned, to successfully pass the checksum verification in MXC_SYS_GetUSN().
  • Only the board's respective sys_me1x.c file is affected.

The following code snippet may be used to duplicate the error:

/**
 * @file    main.c
 * @brief   Hello World!
 * @details This example uses the UART to print to a terminal and flashes an LED.
 */

/***** Includes *****/
#include <stdio.h>
#include <stdint.h>
#include "mxc_device.h"
#include "led.h"
#include "board.h"
#include "mxc_delay.h"
#include "mxc_sys.h"

int main(void)
{
    uint8_t id[MXC_SYS_USN_LEN] = {0};
    uint8_t checksum[MXC_SYS_USN_CHECKSUM_LEN] = {0};
    int flag = 0;

    if(MXC_SYS_GetUSN((uint8_t*)id, (uint8_t*)checksum) != E_NO_ERROR) {
        flag = 1;
        return;
    }

    
    int count = 0;

    printf("Hello World!\n");

    while (1) {
        LED_On(0);
        MXC_Delay(500000);
        LED_Off(0);
        MXC_Delay(500000);
        printf("count = %d\n", count++);
    }
}

@crsz20 crsz20 added bug Something isn't working MAX32655 Related to the MAX32655 (ME17) MAX32670 Related to the MAX32670 (ME15) MAX32662 Related to the MAX32662 (ME12) labels Sep 25, 2024
@github-actions github-actions bot added MAX32675 Related to the MAX32675 (ME16) MAX32680 Related to the MAX32680 (ME20) labels Sep 25, 2024
@crsz20 crsz20 merged commit 0a0614f into main Sep 25, 2024
12 checks passed
sihyung-maxim pushed a commit to analogdevicesinc/hal_adi that referenced this pull request Sep 25, 2024
@kevin-gillespie kevin-gillespie deleted the fix/verify-usn-checksum branch September 25, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working MAX32655 Related to the MAX32655 (ME17) MAX32662 Related to the MAX32662 (ME12) MAX32670 Related to the MAX32670 (ME15) MAX32675 Related to the MAX32675 (ME16) MAX32680 Related to the MAX32680 (ME20)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants