able to build with 52833
This commit is contained in:
@ -32,7 +32,7 @@
|
||||
|
||||
#include "boards.h"
|
||||
|
||||
#ifdef NRF52840_XXAA
|
||||
#ifdef NRF_USBD
|
||||
#include "tusb.h"
|
||||
#endif
|
||||
|
||||
@ -40,11 +40,11 @@
|
||||
|
||||
#define IRQ_ENABLED 0x01 /**< Field identifying if an interrupt is enabled. */
|
||||
|
||||
/**< Maximum number of interrupts available. */
|
||||
/**< Maximum number of interrupts available. (from IRQn_Type) */
|
||||
#if defined(NRF52832_XXAA)
|
||||
#define MAX_NUMBER_INTERRUPTS 39
|
||||
#elif defined(NRF52840_XXAA)
|
||||
#define MAX_NUMBER_INTERRUPTS 48
|
||||
#define MAX_NUMBER_INTERRUPTS 39
|
||||
#elif defined(NRF52840_XXAA) || defined(NRF52833_XXAA)
|
||||
#define MAX_NUMBER_INTERRUPTS 48
|
||||
#endif
|
||||
|
||||
/**@brief Enumeration for specifying current bootloader status.
|
||||
@ -127,9 +127,8 @@ static void wait_for_events(void)
|
||||
// Event received. Process it from the scheduler.
|
||||
app_sched_execute();
|
||||
|
||||
#ifdef NRF52840_XXAA
|
||||
#ifdef NRF_USBD
|
||||
// skip if usb is not inited ( e.g OTA / finializing sd/bootloader )
|
||||
extern bool usb_inited(void);
|
||||
if ( tusb_inited() )
|
||||
{
|
||||
tud_task();
|
||||
|
@ -31,7 +31,7 @@ __root const uint32_t m_uicr_bootloader_start_address @ NRF_UICR_BOOT_START_A
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(NRF52832_XXAA) || defined(NRF52840_XXAA)
|
||||
#if defined(NRF52_SERIES)
|
||||
#if defined ( __CC_ARM )
|
||||
|
||||
uint8_t m_mbr_params_page[CODE_PAGE_SIZE] __attribute__((at(BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS))) __attribute__((used)); /**< This variable reserves a codepage for mbr parameters, to ensure the compiler doesn't locate any code or variables at his location. */
|
||||
@ -50,7 +50,7 @@ __no_init uint8_t m_mbr_params_page[CODE_PAGE_SIZE] @ BOOTLOADER_MBR_PARAMS_
|
||||
__root const uint32_t m_uicr_mbr_params_page_address @ NRF_UICR_MBR_PARAMS_PAGE_ADDRESS = BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS; /**< This variable ensures that the linker script will write the bootloader start address to the UICR register. This value will be written in the HEX file and thus written to UICR when the bootloader is flashed into the chip. */
|
||||
|
||||
#endif
|
||||
#endif // defined(NRF52832_XXAA) || defined(NRF52840_XXAA)
|
||||
#endif // NRF52_SERIES
|
||||
|
||||
|
||||
void bootloader_util_settings_get(const bootloader_settings_t ** pp_bootloader_settings)
|
||||
|
@ -30,22 +30,20 @@
|
||||
#include "app_util.h"
|
||||
|
||||
#define NRF_UICR_BOOT_START_ADDRESS (NRF_UICR_BASE + 0x14) /**< Register where the bootloader start address is stored in the UICR register. */
|
||||
|
||||
#if defined(NRF52832_XXAA) || defined(NRF52840_XXAA)
|
||||
#define NRF_UICR_MBR_PARAMS_PAGE_ADDRESS (NRF_UICR_BASE + 0x18) /**< Register where the mbr params page is stored in the UICR register. (Only in use in nRF52 MBR).*/
|
||||
#endif
|
||||
|
||||
#define CODE_REGION_1_START SD_SIZE_GET(MBR_SIZE) /**< This field should correspond to the size of Code Region 0, (which is identical to Start of Code Region 1), found in UICR.CLEN0 register. This value is used for compile safety, as the linker will fail if application expands into bootloader. Runtime, the bootloader will use the value found in UICR.CLEN0. */
|
||||
#define SOFTDEVICE_REGION_START MBR_SIZE /**< This field should correspond to start address of the bootloader, found in UICR.RESERVED, 0x10001014, register. This value is used for sanity check, so the bootloader will fail immediately if this value differs from runtime value. The value is used to determine max application size for updating. */
|
||||
#define CODE_PAGE_SIZE 0x1000 /**< Size of a flash codepage. Used for size of the reserved flash space in the bootloader region. Will be runtime checked against NRF_UICR->CODEPAGESIZE to ensure the region is correct. */
|
||||
|
||||
|
||||
#if defined(NRF52832_XXAA)
|
||||
// Flash = 512 KB
|
||||
#if defined(NRF52832_XXAA) || defined(NRF52833_XXAA)
|
||||
|
||||
#define BOOTLOADER_REGION_START 0x00074000 /**< This field should correspond to start address of the bootloader, found in UICR.RESERVED, 0x10001014, register. This value is used for sanity check, so the bootloader will fail immediately if this value differs from runtime value. The value is used to determine max application size for updating. */
|
||||
#define BOOTLOADER_SETTINGS_ADDRESS 0x0007F000 /**< The field specifies the page location of the bootloader settings address. */
|
||||
#define BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS 0x0007E000 /**< The field specifies the page location of the mbr params page address. */
|
||||
|
||||
// Flash = 1024 KB
|
||||
#elif defined(NRF52840_XXAA)
|
||||
|
||||
#define BOOTLOADER_REGION_START 0x000F4000 /**< This field should correspond to start address of the bootloader, found in UICR.RESERVED, 0x10001014, register. This value is used for sanity check, so the bootloader will fail immediately if this value differs from runtime value. The value is used to determine max application size for updating. */
|
||||
|
Reference in New Issue
Block a user