diff options
| author | hathach <[email protected]> | 2014-04-08 12:23:01 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2014-04-08 12:23:01 +0700 |
| commit | 6404b063411195408e602f896346baba7d7b338d (patch) | |
| tree | fa98f5e4255e31399bba7b95134e10a304235747 | |
| parent | 31a10c97806e0d07875a150b44c62fd9b48f6dfa (diff) | |
added IAR flash loader for NGX4330 or lpc18/43xx
| -rw-r--r-- | mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.board | 9 | ||||
| -rw-r--r-- | mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.flash | 10 | ||||
| -rw-r--r-- | mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.mac | 31 | ||||
| -rw-r--r-- | mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.out | bin | 0 -> 48000 bytes | |||
| -rw-r--r-- | mcu/lpc43xx/iar/lpc18xx_43xx_debug.mac | 18 | ||||
| -rw-r--r-- | mcu/lpc43xx/iar/lpc4330_m4_spifi.icf | 6 |
6 files changed, 71 insertions, 3 deletions
diff --git a/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.board b/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.board new file mode 100644 index 000000000..dcc8304c3 --- /dev/null +++ b/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.board @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="iso-8859-1"?> + +<flash_board> + <pass> + <loader>C:\Users\hathach\Dropbox\tinyusb\workspace\tinyusb\mcu\lpc43xx\iar\FlashLPC18xx_43xx_SPIFI.flash</loader> + </pass> +</flash_board> + + diff --git a/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.flash b/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.flash new file mode 100644 index 000000000..95d48ff00 --- /dev/null +++ b/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.flash @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="iso-8859-1"?> + +<flash_device> + <exe>C:\Users\hathach\Dropbox\tinyusb\workspace\tinyusb\mcu\lpc43xx\iar\FlashLPC18xx_43xx_SPIFI.out</exe> + <page>256</page> + <block>1 0x4000000</block> + <flash_base>0x14000000</flash_base> + <macro>C:\Users\hathach\Dropbox\tinyusb\workspace\tinyusb\mcu\lpc43xx\iar\FlashLPC18xx_43xx_SPIFI.mac</macro> + <aggregate>1</aggregate> +</flash_device> diff --git a/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.mac b/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.mac new file mode 100644 index 000000000..fdb5506f9 --- /dev/null +++ b/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.mac @@ -0,0 +1,31 @@ +__Setup() +{ + /* set SPIFI clock */ + //LPC_CGU->BASE_SPIFI0_CLK = 1<<24 | 1<<11; /* IRC 12 MHz is good enough for us */ + __writeMemory32( 1<<24 | 1<<11, 0x40051304, "Memory"); + + //LPC_SCU->SFSP3_3 = 0xF3; /* high drive for SCLK */ + __writeMemory32( 0xF3, 0x4008618C, "Memory"); + +/* IO pins */ + //LPC_SCU->SFSP3_4=LPC_SCU->SFSP3_5=LPC_SCU->SFSP3_6=LPC_SCU->SFSP3_7 = 0xD3; + __writeMemory32( 0xD3, 0x40086190, "Memory"); + __writeMemory32( 0xD3, 0x40086194, "Memory"); + __writeMemory32( 0xD3, 0x40086198, "Memory"); + __writeMemory32( 0xD3, 0x4008619C, "Memory"); + //LPC_SCU->SFSP3_8 = 0x13; /* CS doesn't need feedback */ + __writeMemory32( 0x13, 0x400861A0, "Memory"); + + __writeMemory32(0x14000000, 0x40043100, "Memory"); // map SPIFI to shadow area at address 0 +} + +execUserReset() +{ + __message "----- execUserReset\n"; + __Setup(); +} + +execUserFlashInit(){ + __message "----- execUserFlashInit\n"; + __Setup(); +} diff --git a/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.out b/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.out Binary files differnew file mode 100644 index 000000000..a496babc7 --- /dev/null +++ b/mcu/lpc43xx/iar/FlashLPC18xx_43xx_SPIFI.out diff --git a/mcu/lpc43xx/iar/lpc18xx_43xx_debug.mac b/mcu/lpc43xx/iar/lpc18xx_43xx_debug.mac new file mode 100644 index 000000000..4bff3d192 --- /dev/null +++ b/mcu/lpc43xx/iar/lpc18xx_43xx_debug.mac @@ -0,0 +1,18 @@ +__Setup(){ +__writeMemory32((int)&__vector_table, 0x40043100, "Memory"); // map BootArea to shadow area at address 0 +__writeMemory32((int)&__vector_table, 0xE000ED08, "Memory"); // map BootArea to shadow area at address 0 +__message "Memory at: ", &__vector_table, " mapped to 0x00000000\n"; +} + +execUserReset() +{ + __message "execUserReset\n"; + __Setup(); + __message "execUserReset Finish\n"; +} + +execUserFlashInit(){ + __message "execUserFlashInit\n"; + __Setup(); + __message "execUserFlashInit Finish\n"; +} diff --git a/mcu/lpc43xx/iar/lpc4330_m4_spifi.icf b/mcu/lpc43xx/iar/lpc4330_m4_spifi.icf index 7ecf99479..abf1ae806 100644 --- a/mcu/lpc43xx/iar/lpc4330_m4_spifi.icf +++ b/mcu/lpc43xx/iar/lpc4330_m4_spifi.icf @@ -55,6 +55,6 @@ place in PD_LOCAL_SRAM_region { section .pd_local_sram }; place in AHB_SRAM2_region { section .ahb_sram2 }; place in ETB_SRAM_region { section .etb_sram }; -place in RAM_region { readonly }; -place in AHB_SRAM1_region { readwrite, - block CSTACK, block HEAP };
\ No newline at end of file +place in ROM_region { readonly }; +place in RAM_region { readwrite, + block CSTACK, block HEAP };
\ No newline at end of file |
