Changeset 3039


Ignore:
Timestamp:
Jul 6, 2012, 9:46:38 AM (3 years ago)
Author:
quozl
Message:

TI BSL downloader - reverse polarity of test result report, cleanup messages, report timeout of flush, and initialise UART2 APB clocks and UART enable bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/olpc/bsl.fth

    r3034 r3039  
    4242
    4343: bsl-baud  ( baud-rate -- )   \ 9600,8,e,1
    44    uart-base >r  bsl-uart-base to uart-base  baud  h# 1b 3 uart!  r> to uart-base
     44   uart-base >r                 ( baud-rate r: uart-base )
     45   bsl-uart-base to uart-base
     46   h# 13 h# 30 apbc!                                            \ enable the uart2 clocks
     47   h# 40 1 uart!                                                \ uart unit enable
     48   baud  h# 1b 3 uart!          ( r: uart-base )
     49   r> to uart-base              ( )
    4550;
    4651
     
    8994   bsl-test-gpio# gpio-clr
    9095;
    91 : flush-bsl  ( -- )  begin  receive?  while  drop  repeat  ;
     96
     97: flush-bsl
     98   get-msecs d# 2000 +                  ( limit )
     99   begin
     100      receive?  0=  if  exit  then      ( limit char )
     101      drop  dup get-msecs - 0<          ( limit timeout? )
     102   until
     103   drop  true abort" BSL flush timeout"
     104;
     105
    92106: rst-bsl  ( -- )  msp430-off  start-bsl  flush-bsl  ;
    93107
     
    103117   drop  true abort" BSL data timeout"
    104118;
     119
    105120: ack?  ( -- okay? )
    106121   get-msecs timeout +        ( limit )
     
    263278
    264279: force-erase  ( -- )
    265    ." Resetting/erasing" cr
    266280   rst-bsl
    267281   ['] 00-password catch drop
     
    369383   $read-open           ( )
    370384   set-bsl-file-format  ( )
     385   ." Resetting/erasing" cr
    371386   force-erase          ( )
    372387   ." Programming" cr
     
    429444   ." Writing ..." bsl-test-data h# 8000 bsl-write  cr  ( )
    430445   ." Verifying ..."  bsl-test-data h# 8000 bsl-verify  cr  ( okay? )
    431    if  ." FAILED!"  else  ." Good"  then  cr
     446   if  ." Good"  else  ." FAILED!"  then  cr
    432447;
    433448
Note: See TracChangeset for help on using the changeset viewer.