Merge pull request #1112 from openmv/uid_fix

Define UID size in board config.
This commit is contained in:
Ibrahim Abd Elkader 2021-01-07 20:46:04 +02:00 committed by GitHub
commit 03c6353919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 4 deletions

View File

@ -15,6 +15,7 @@
#define OMV_ARCH_STR "NANO33 M4" // 33 chars max
#define OMV_BOARD_TYPE "NANO33"
#define OMV_UNIQUE_ID_ADDR 0x10000060
#define OMV_UNIQUE_ID_SIZE 2 // 2 words
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->bpp

View File

@ -15,6 +15,7 @@
#define OMV_ARCH_STR "OMV2 F4 256 JPEG" // 33 chars max
#define OMV_BOARD_TYPE "M4"
#define OMV_UNIQUE_ID_ADDR 0x1FFF7A10
#define OMV_UNIQUE_ID_SIZE 3 // 3 words
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->bpp

View File

@ -15,6 +15,7 @@
#define OMV_ARCH_STR "OMV3 F7 512" // 33 chars max
#define OMV_BOARD_TYPE "M7"
#define OMV_UNIQUE_ID_ADDR 0x1FF0F420
#define OMV_UNIQUE_ID_SIZE 3 // 3 words
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->bpp

View File

@ -15,6 +15,7 @@
#define OMV_ARCH_STR "OMV4 H7 1024" // 33 chars max
#define OMV_BOARD_TYPE "H7"
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800
#define OMV_UNIQUE_ID_SIZE 3 // 3 words
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->bpp

View File

@ -15,6 +15,7 @@
#define OMV_ARCH_STR "OMV4P H7 32768 SDRAM" // 33 chars max
#define OMV_BOARD_TYPE "H7"
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800
#define OMV_UNIQUE_ID_SIZE 3 // 3 words
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer overlay stack.
#define OMV_SELF_TEST_SWD_ADDR *((uint32_t *) 0x24000018)

View File

@ -15,6 +15,7 @@
#define OMV_ARCH_STR "OPENMVPT 65536 SDRAM" // 33 chars max
#define OMV_BOARD_TYPE "H7"
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800
#define OMV_UNIQUE_ID_SIZE 3 // 3 words
// Flash sectors for the bootloader.
// Flash FS sector, main FW sector, max sector.

View File

@ -15,6 +15,7 @@
#define OMV_ARCH_STR "PORTENTA H7 8192 SDRAM" // 33 chars max
#define OMV_BOARD_TYPE "H7"
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800
#define OMV_UNIQUE_ID_SIZE 3 // 3 words
// Flash sectors for the bootloader.
// Flash FS sector, main FW sector, max sector.

View File

@ -149,11 +149,17 @@ void usbdbg_data_in(void *buffer, int length)
break;
case USBDBG_ARCH_STR: {
unsigned int uid[3] = {
#if (OMV_UNIQUE_ID_SIZE == 2)
0U,
#else
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + 8)),
#endif
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + 4)),
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + 0)),
};
snprintf((char *) buffer, 64, "%s [%s:%08X%08X%08X]",
OMV_ARCH_STR, OMV_BOARD_TYPE,
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + 8)),
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + 4)),
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + 0)));
OMV_ARCH_STR, OMV_BOARD_TYPE, uid[0], uid[1], uid[2]);
cmd = USBDBG_NONE;
break;
}