added IAR flash loader for NGX4330 or lpc18/43xx

This commit is contained in:
hathach 2014-04-08 12:23:01 +07:00
parent 31a10c9780
commit 6404b06341
6 changed files with 71 additions and 3 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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();
}

Binary file not shown.

View File

@ -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";
}

View File

@ -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 };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block HEAP };