Skip to main content
Visitor II
March 12, 2007
Question

ST10F269 flash

  • March 12, 2007
  • 6 replies
  • 1314 views
Posted on March 12, 2007 at 12:12

ST10F269 flash

    This topic has been closed for replies.

    6 replies

    Visitor II
    March 8, 2007
    Posted on March 08, 2007 at 14:47

    Hi,

    I can not find my mistake. I want to clear the Int. flash & it does not work.

    May somebody have a look in my code?

    The code is executed from RAM, it's ok.

    Thanks a lot.

    Gabi

    mkC ST10F269

    [ This message was edited by: gaby_bradu on 08-03-2007 19:19 ]

    :o Sometimes there are very simple errors.

    It Works.

    [ This message was edited by: gaby_bradu on 09-03-2007 09:59 ]

    ________________

    Attachments :

    erase.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0M4&d=%2Fa%2F0X0000000bXp%2FYnJsO25iXiCbb1JXMY8xvkyBJyVs3rxbsYiySUwSbc8&asPdf=false
    Visitor II
    March 9, 2007
    Posted on March 09, 2007 at 11:04

    Thanks Neila,

    ROMEN = 1

    ROMS = 0

    R8&9 - (0/0; 0/4; 0/6; 1/0; 2/0...)

    It works for the Bank 0 R8&R9 = 0. (deletes my software :))

    My controler goes through reset if I call the function below, on this point:

    MOV [R5],R7

    :(

    Is something wrong configured?

    Thanks a lot,

    Gabi.

    PFlash_RP PROC NEAR

    MOV R1, #2H ; The second page

    MOV R5, #02A54H ; For the 1st & 3rd write

    MOV R6, #015A8H ; For the 2nd write

    MOV R2, #0A8H ;

    MOV R3, #54H ;

    MOV R7, #90H ;

    EXTS R1, #4

    MOV [R5],R2 ; 1st command

    MOV [R6],R3 ; 2nd command

    MOV [R5],R7 ; 3rd command

    MOV R4,[R1] ; 4th command

    RET

    PFlash_RP ENDP

    [ This message was edited by: gaby_bradu on 09-03-2007 15:36 ]

    [ This message was edited by: gaby_bradu on 09-03-2007 15:45 ]

    Visitor II
    March 12, 2007
    Posted on March 12, 2007 at 07:30

    Hi Neila,

    Thank you for your help.

    The WDTCON register I did not read. The following hardware traps are analysed in my software & no one comes:

    void NMI_trap (void) interrupt 0x02{...trap_cause = TFR;...}

    void STKOF_trap (void) interrupt 0x04{...trap_cause = TFR;...}

    void STKUF_trap (void) interrupt 0x06{...trap_cause = TFR;...}

    void Class_B_trap (void) interrupt 0x0A{...trap_cause = TFR;...}

    But I'll check all this points once more & I'll be back soon.

    Thanks a lot.

    Gaby.

    8-)

    Visitor II
    March 12, 2007
    Posted on March 12, 2007 at 10:36

    So I'm back, I did some tests......

    it was the watchdog, after the RP function and it restarts I read 0x06. But it can not be because I service the WD. I disabled the WD

    DISWDT

    EINIT

    and now it hangs-up. :(

    I did a small change in the RP procedure and it never returns:

    EXTS R1, #3

    MOV [R5],R2 ; 1st command

    MOV [R6],R3 ; 2nd command

    MOV [R5],R7 ; 3rd command

    RET

    MOV R4,[R1] ; 4th command

    The generated code from RP function is:

    :10300000E021E6F5542AE6F6A815E6F2A800E6F374

    :103010005400E6F79000DC21B825B836B875CB002F

    :04302000A841CB00F8

    After the instruction B875 it hangs-up.

    Thanks,

    Gaby.

    P.S. I copy this code on address 0xC000 (or 0xE000), it's free.

    int (*PFlash_RPP)(void);

    .....

    PFlash_RPP = (void *)0xC000;

    xmemcpy((ubyte huge *)PFlash_RPP, (ubyte huge *)PFlash_RP, 80);

    .....

    tst = PFlash_RPP();

    [ This message was edited by: gaby_bradu on 12-03-2007 15:55 ]

    Visitor II
    March 12, 2007
    Posted on March 12, 2007 at 11:46

    Hi Neila,

    I send the sources on your e-mail (neila_kraiem@yahoo.fr). The rest you can see from the code.

    Thanks,

    Gaby.

    Visitor II
    March 12, 2007
    Posted on March 12, 2007 at 12:12

    My e-mail is:

    mailto:gaby_bradu@yahoo.com

    Gaby.