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

Add some processing to the WB32 MCU series. #324

Merged
merged 5 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions os/common/ext/CMSIS/WB32/WB32F3G71xx/wb32f3g71xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,24 @@ typedef struct
#warning Not supported compiler type
#endif



static const uint32_t flash_size_code_map[16] = {
0x80000, /* 512kB */
0x8000, /* 32kB */
0x60000, /* 384kB */
0x40000, /* 256kB */
0x20000, /* 128kB */
0x8000, /* 32kB */
0x18000, /* 96kB */
0x10000, /* 64kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x30000, /* 192kB */
};

/* ================================================================================ */
/* ================ Peripheral memory map ================ */
Expand All @@ -958,6 +974,9 @@ typedef struct
#define SRAM_BB_BASE ((uint32_t)0x22000000UL) /*!< SRAM base address in the bit-band region */
#define PERIPH_BB_BASE ((uint32_t)0x42000000UL) /*!< Peripheral base address in the bit-band region */

#define SYS_MEMSE ((uint32_t)0x40016404UL)
#define FLASH_SIZE flash_size_code_map[(*((volatile uint32_t *)(SYS_MEMSE))) & 0xFU]

#define APB1PERIPH_BASE PERIPH_BASE
#define APB2PERIPH_BASE (PERIPH_BASE + 0x08000)
#define AHBPERIPH_BASE (PERIPH_BASE + 0x10000)
Expand Down
21 changes: 21 additions & 0 deletions os/common/ext/CMSIS/WB32/WB32FQ95xx/wb32fq95xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,24 @@ typedef struct
#warning Not supported compiler type
#endif

static const uint32_t flash_size_code_map[16] = {
0x80000, /* 512kB */
0x8000, /* 32kB */
0x60000, /* 384kB */
0x40000, /* 256kB */
0x20000, /* 128kB */
0x8000, /* 32kB */
0x18000, /* 96kB */
0x10000, /* 64kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x8000, /* 32kB */
0x30000, /* 192kB */
};

/* ================================================================================ */
/* ================ Peripheral memory map ================ */
Expand All @@ -901,6 +919,9 @@ typedef struct
#define SRAM_BB_BASE ((uint32_t)0x22000000UL) /*!< SRAM base address in the bit-band region */
#define PERIPH_BB_BASE ((uint32_t)0x42000000UL) /*!< Peripheral base address in the bit-band region */

#define SYS_MEMSE ((uint32_t)0x40016404UL)
#define FLASH_SIZE flash_size_code_map[(*((volatile uint32_t *)(SYS_MEMSE))) & 0xFU]

#define APB1PERIPH_BASE PERIPH_BASE
#define APB2PERIPH_BASE (PERIPH_BASE + 0x08000)
#define AHBPERIPH_BASE (PERIPH_BASE + 0x10000)
Expand Down
1 change: 1 addition & 0 deletions os/hal/ports/WB32/LLD/USBv1/hal_usb_lld.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ struct USBDriver {
WB32_USB->POWER |= USB_POWER_RESUME; \
osalThreadSleepMilliseconds(WB32_USB_HOST_WAKEUP_DURATION); \
WB32_USB->POWER &= ~USB_POWER_RESUME; \
_usb_wakeup(usbp); \
itarze marked this conversation as resolved.
Show resolved Hide resolved
} while (false)

/*===========================================================================*/
Expand Down
Loading