Skip to content

Commit

Permalink
Merge pull request ChibiOS#324 from WestberryTech/chibios-21.11.x-wb
Browse files Browse the repository at this point in the history
Add some processing to the WB32 MCU series.
  • Loading branch information
fpoussin committed Jul 27, 2022
2 parents 966c488 + ccd4fea commit d03aa9c
Show file tree
Hide file tree
Showing 11 changed files with 1,328 additions and 5 deletions.
23 changes: 21 additions & 2 deletions os/common/ext/CMSIS/WB32/WB32F3G71xx/wb32f3g71xx.h
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
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
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); \
} while (false)

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

0 comments on commit d03aa9c

Please sign in to comment.