This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Monitor error 3

When I am using the monitor in boostrap mode I cannot sucessfully download code. I keep getting the error
*** MONITOR ERROR 3 : CANNTOT WRITE TO ADDRESS E7AAAA.
I am using an in house designed board with 64K RAM on CS2 at address 40000H.
I have set the followinging in config.inc
%DEFINE (DATA_START) (40000H)
%DEFINE (CODE_START) (42000H)
I have also Added the following reserve lines
8H-0BH, 0ACH-0AFH

Please help. I am at my wits end


Parents Reply Children
  • Cheers for the help Mike.

    Here is a snippet of the m66 file.

    MEMORY MAP OF MODULE: Monitor (INST167)


    START STOP LENGTH TYPE RTYP ALIGN TGR GRP COMB CLASS SECTION NAME
    =====================================================================================
    000000H 000001H 000002H CODE REL WORD --- --- PRIV FCODE ?C_STI_INIT
    000002H 000003H 000002H CODE REL WORD --- --- PRIV FCODE ?C_STD_INIT
    000008H 00000BH 000004H --- --- --- --- --- --- * RESERVED MEMORY *
    0000ACH 0000AFH 000004H --- --- --- --- --- --- * RESERVED MEMORY *
    040000H --- 000000H DATA ABS AT.. --- --- PRIV M_DATA MON166_DATA_START
    040000H 0400A1H 0000A2H DATA REL WORD --- --- PUBL M_DATA MON166_W_DATA
    0400A2H 0400ADH 00000CH CODE REL WORD --- --- PRIV M_DATA MON166_EXEC
    0400AEH 0401B7H 00010AH DATA REL BYTE --- --- PUBL M_DATA MON166_B_DATA
    040800H 040863H 000064H CODE ABS AT.. --- --- PRIV --- INIT_CODE
    040864H 0418A5H 001042H CODE REL WORD --- --- PUBL --- MON166_CODE
    0418A6H 041A27H 000182H CODE REL WORD --- --- PUBL --- MON166_CONST


    I think it looks fine. Any more suggestions ?

  • I have also Added the following reserve lines
    8H-0BH, 0ACH-0AFH


    Those lines are supposed to be added not to the monitor's linker configuration, but to the application's. They prevent the application from using these memory areas because the monitor uses them as interrupt vectors. The monitor will not overwrite them during download anyway, so the RESERVE directive only prevents the warning.
    By the way, the interrupt vector table MUST be in RAM, otherwise the monitor in bootstrap mode simply will not work. You have to change your boards memory layout - the RAM area must start at 0. You will have to modify ADDRSELx registers.
    There may be other points that you are missing. Read Keil's documentation on Monitor166: Keil\C166\hlp\GS166.PDF, Keil\C166\MONITOR\README.TXT. Look through articles on Monitor166 in Keil's Support Knowledgebase:
    http://www.keil.com/support/index.asp?product=MON166&title=MON166%20Target%20Monitor

    It took me a while to get the monitor working first time: simply finding the working configuration can be very tricky.
    Regards,
    - Mike

  • We have just had the same problem, but have tracked it down.

    We had defined a C-accessible variable in the mm310.a66 startup file, using the DW statement. DW creates an initialised variable - the monitor initialises it not the application. However, the monitor and application have different memory maps. The monitor was reading the location of the variable from the uploaded .h86 file, but whereas the monitor considered that location to be in external flash (and couldn't write there, hence the error), our application configures that to be in external SRAM.

    The solution was to use the DS statement instead of DW - this is an uninitialised variable so the monitor never tries to write to the external flash.