From 94b234b7918dd72f5beaed5944b1f96c8f3f3ba6 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Sun, 13 Dec 2009 23:30:58 +0100 Subject: [PATCH] we can write 0x00 at 0xf4000, but nothing else... :( also added the a pragma section found in flash.c to all c-files... dunno if it actually changes something. --- pkernel/main.c | 30 ++++++++++++++++++++++++++---- pkernel/mb91465k.asm | 1 + pkernel/rlt.c | 1 + pkernel/start91460.asm | 1 + pkernel/uart.c | 1 + pkernel/vectors.c | 1 + 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/pkernel/main.c b/pkernel/main.c index a001e87..2e024d2 100644 --- a/pkernel/main.c +++ b/pkernel/main.c @@ -3,12 +3,13 @@ #include "rlt.h" #include "flash.h" +#pragma section CODE=IRAM,attr=CODE void main(void) { unsigned char error = 0; unsigned char global_error = 0; unsigned int i, baseaddr; - unsigned int toflash[] = {0x9b00, + unsigned int toflash2[] = {0x9b00, 0x0d4e, 0xcff1, 0x1601, @@ -17,6 +18,7 @@ void main(void) 0xc106, 0x1656, 0xe0fb}; //len = 9 + unsigned int toflash[] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}; //len = 9 /* Enable Clock Monitor */ CSCFG_MONCKI = 1; @@ -65,7 +67,7 @@ void main(void) i++; if( (i % 0x10) == 0 ) Puts4("\n"); } - Puts4("\n"); + Puts4("\n"); i = 0; @@ -73,7 +75,7 @@ void main(void) for(; i<9; i++) { Puts4("\nwrite: "); error = FLASH_WriteHalfWord(baseaddr + (2*i), toflash[i]); - Puts4(error == 1 ? "[sucess] " : "[failed] "); + Puts4(error == 1 ? "[sucess] " : "[failed] "); Puts4("0x"); Puthex4(toflash[i], 4); Puts4(" @0x"); @@ -88,8 +90,28 @@ void main(void) i++; if( (i % 0x10) == 0 ) Puts4("\n"); } - Puts4("\n"); + Puts4("\n================================================================\n"); + i = 0; + baseaddr = 0xf4000; + for(; i<9; i++) { + Puts4("\nwrite: "); + error = FLASH_WriteHalfWord(baseaddr + (2*i), toflash2[i]); + Puts4(error == 1 ? "[sucess] " : "[failed] "); + Puts4("0x"); + Puthex4(toflash2[i], 4); + Puts4(" @0x"); + Puthex4(baseaddr + (2*i), 6); + } + + i=0; + Puts4("\nCurrent Content of FLASH at 0xf4000 ... 0xf401F:\n"); + while(i < 0x20) + { + Puts4("0x"); Puthex4( *(unsigned char *)(0xf4000 + i), 2); Puts4(" "); + i++; + if( (i % 0x10) == 0 ) Puts4("\n"); + } /* Output Ready Meassage */ if( global_error != 0 ) diff --git a/pkernel/mb91465k.asm b/pkernel/mb91465k.asm index 3a26aa8..f029ef2 100644 --- a/pkernel/mb91465k.asm +++ b/pkernel/mb91465k.asm @@ -9,6 +9,7 @@ 1.00 UMa Initial Version -----------------------------------------------------------------------------*/ +#pragma section CODE=IRAM,attr=CODE #define __IO_DEFINE #include "mb91465k.h" diff --git a/pkernel/rlt.c b/pkernel/rlt.c index 58f9c76..14076a3 100644 --- a/pkernel/rlt.c +++ b/pkernel/rlt.c @@ -7,6 +7,7 @@ #include "rlt.h" +#pragma section CODE=IRAM,attr=CODE void RLT_InitializeTimer(unsigned char channel, unsigned char runmode, unsigned char clockmode, unsigned char triggermode, unsigned char outputmode) { unsigned short setvalue = 0x00; diff --git a/pkernel/start91460.asm b/pkernel/start91460.asm index 9f3190e..a687a51 100644 --- a/pkernel/start91460.asm +++ b/pkernel/start91460.asm @@ -1577,6 +1577,7 @@ _wait64_loop: #endm .section CODE, code, align=4 .section CODE_START, code, align=4 +#pragma section CODE=IRAM,attr=CODE ;========================================================================================= diff --git a/pkernel/uart.c b/pkernel/uart.c index 738ff46..16e79de 100644 --- a/pkernel/uart.c +++ b/pkernel/uart.c @@ -6,6 +6,7 @@ #include "mb91465k.h" +#pragma section CODE=IRAM,attr=CODE const char ASCII[] = "0123456789ABCDEF"; void InitUart4(void) diff --git a/pkernel/vectors.c b/pkernel/vectors.c index 448f33b..eddff7d 100644 --- a/pkernel/vectors.c +++ b/pkernel/vectors.c @@ -18,6 +18,7 @@ #include "mb91465k.h" #include "rlt.h" +#pragma section CODE=IRAM,attr=CODE /*------------------------------------------------------------------------ InitIrqLevels() -- 2.25.1