we can write 0x00 at 0xf4000, but nothing else... :(
authorBernhard Urban <lewurm@gmx.net>
Sun, 13 Dec 2009 22:30:58 +0000 (23:30 +0100)
committerBernhard Urban <lewurm@gmx.net>
Sun, 13 Dec 2009 22:30:58 +0000 (23:30 +0100)
also added the a pragma section found in flash.c to all c-files... dunno
if it actually changes something.

pkernel/main.c
pkernel/mb91465k.asm
pkernel/rlt.c
pkernel/start91460.asm
pkernel/uart.c
pkernel/vectors.c

index a001e876ee8970803dcbe9f1f5843f4a7486583c..2e024d27c89614751f1a5f28ba3a4ea5ebe2d133 100644 (file)
@@ -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 )
index 3a26aa8f5bb168b47d6694bc94b1be0825b7d384..f029ef23a9f58a49a739d8a4214f509f69a86124 100644 (file)
@@ -9,6 +9,7 @@
             1.00   UMa    Initial Version
 -----------------------------------------------------------------------------*/
 
+#pragma section CODE=IRAM,attr=CODE
 
 #define __IO_DEFINE
 #include "mb91465k.h"
index 58f9c76a0ec1c74c291fdec4f0f62b4a67618636..14076a3a810dc4dc00e18f66c31ee7d7da8d03b9 100644 (file)
@@ -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;
index 9f3190ee7de54b7467acd3fe6afa067b69812195..a687a51534a3969e98d116d470593ea9f1784cd3 100644 (file)
@@ -1577,6 +1577,7 @@ _wait64_loop:
 #endm
         .section        CODE, code, align=4
         .section        CODE_START, code, align=4
+#pragma section CODE=IRAM,attr=CODE
 
 
 ;=========================================================================================
index 738ff46f0fa30b572137845b052fb2491d10fbe6..16e79de5ddcfbaa392e43e9f4f37d36635e6a75a 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "mb91465k.h"
 
+#pragma section CODE=IRAM,attr=CODE
 const char ASCII[] = "0123456789ABCDEF";
 
 void InitUart4(void)
index 448f33b850867da568dd0ba4a7b2ff31ec595170..eddff7d1918992a8cf0dd18ef93977d99a63997c 100644 (file)
@@ -18,6 +18,7 @@
 #include "mb91465k.h"
 #include "rlt.h"
 
+#pragma section CODE=IRAM,attr=CODE
 /*------------------------------------------------------------------------
   InitIrqLevels()