mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #1797 from openmv/unique_add_offset
boards/all: Add a bytes offset config option for multi-word UIDs.
This commit is contained in:
commit
58ee7322fa
@ -16,9 +16,11 @@
|
||||
#define OMV_BOARD_TYPE "PICO"
|
||||
|
||||
#ifndef LINKER_SCRIPT
|
||||
extern unsigned char *OMV_UNIQUE_ID_ADDR;
|
||||
extern unsigned char *OMV_UNIQUE_ID_ADDR; // Unique address.
|
||||
#endif
|
||||
#define OMV_UNIQUE_ID_SIZE 2 // 2 words
|
||||
#define OMV_UNIQUE_ID_SIZE 2 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -14,8 +14,9 @@
|
||||
// Architecture info
|
||||
#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
|
||||
#define OMV_UNIQUE_ID_ADDR 0x10000060 // Unique ID address.
|
||||
#define OMV_UNIQUE_ID_SIZE 2 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -14,8 +14,10 @@
|
||||
// Architecture info
|
||||
#define OMV_ARCH_STR "NICLAV H7 1024" // 33 chars max
|
||||
#define OMV_BOARD_TYPE "NICLAV"
|
||||
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // 3 words
|
||||
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800 // Unique ID address.
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -14,8 +14,9 @@
|
||||
// Architecture info
|
||||
#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
|
||||
#define OMV_UNIQUE_ID_ADDR 0x1FFF7A10 // Unique ID address.
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
|
||||
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt
|
||||
|
||||
@ -14,8 +14,9 @@
|
||||
// Architecture info
|
||||
#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
|
||||
#define OMV_UNIQUE_ID_ADDR 0x1FF0F420 // Unique ID address.
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
|
||||
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt
|
||||
|
||||
@ -14,8 +14,9 @@
|
||||
// Architecture info
|
||||
#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
|
||||
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800 // Unique ID address.
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
|
||||
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt
|
||||
|
||||
@ -14,8 +14,9 @@
|
||||
// Architecture info
|
||||
#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
|
||||
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800 // Unique ID address.
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// 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)
|
||||
|
||||
@ -14,8 +14,9 @@
|
||||
// Architecture info
|
||||
#define OMV_ARCH_STR "OMV4 H7 PRO 32768 SDRAM" // 33 chars max
|
||||
#define OMV_BOARD_TYPE "H7"
|
||||
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // 3 words
|
||||
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800 // Unique ID address.
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// 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)
|
||||
|
||||
@ -14,8 +14,9 @@
|
||||
// Architecture info
|
||||
#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
|
||||
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800 // Unique ID address.
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -16,9 +16,10 @@
|
||||
#define OMV_BOARD_TYPE "PICO"
|
||||
|
||||
#ifndef LINKER_SCRIPT
|
||||
extern unsigned char *OMV_UNIQUE_ID_ADDR;
|
||||
extern unsigned char *OMV_UNIQUE_ID_ADDR; // Unique ID address.
|
||||
#endif
|
||||
#define OMV_UNIQUE_ID_SIZE 2 // 2 words
|
||||
#define OMV_UNIQUE_ID_SIZE 2 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -14,8 +14,9 @@
|
||||
// Architecture info
|
||||
#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
|
||||
#define OMV_UNIQUE_ID_ADDR 0x1FF1E800 // Unique ID address.
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -58,7 +58,8 @@ void usbdbg_init()
|
||||
|
||||
void usbdbg_wait_for_command(uint32_t timeout)
|
||||
{
|
||||
for (mp_uint_t ticks = mp_hal_ticks_ms(); irq_enabled && ((mp_hal_ticks_ms() - ticks) < timeout) && (cmd != USBDBG_NONE); );
|
||||
for (mp_uint_t ticks = mp_hal_ticks_ms();
|
||||
irq_enabled && ((mp_hal_ticks_ms() - ticks) < timeout) && (cmd != USBDBG_NONE); );
|
||||
}
|
||||
|
||||
bool usbdbg_script_ready()
|
||||
@ -167,10 +168,10 @@ void usbdbg_data_in(void *buffer, int length)
|
||||
#if (OMV_UNIQUE_ID_SIZE == 2)
|
||||
0U,
|
||||
#else
|
||||
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + 8)),
|
||||
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + OMV_UNIQUE_ID_OFFSET * 2)),
|
||||
#endif
|
||||
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + 4)),
|
||||
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + 0)),
|
||||
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + OMV_UNIQUE_ID_OFFSET * 1)),
|
||||
*((unsigned int *) (OMV_UNIQUE_ID_ADDR + OMV_UNIQUE_ID_OFFSET * 0)),
|
||||
};
|
||||
snprintf((char *) buffer, 64, "%s [%s:%08X%08X%08X]",
|
||||
OMV_ARCH_STR, OMV_BOARD_TYPE, uid[0], uid[1], uid[2]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user