Menu

TinyPicBootloader+ (v0.6.2)'s the first and the last four words codes.

Bug report
Dan
2013-04-11
2013-04-14
  • Dan

    Dan - 2013-04-11

    Dear Edorul.

    Thank you very much for me to grant my hope.
    I made a test of Programmer immediately.
    the last four words and the first four words are Wrong codes.
    And reports it with a log.
    Thanks.

    <Test Program="">
    00001 ;Test Program for TinyPicBootloader+ (v0.6.2)
    00002
    00003
    00004 LIST P=PIC10F322
    00005
    0000 00006 ORG 0x0000
    00007
    0000 3001 00008 movlw 0x01
    0001 00E0 00009 movwf 0x60
    0002 0000 00010 nop
    0003 2804 00011 goto INIT
    00012
    0004 00013 INIT
    0004 2804 00014 goto $
    00015
    00016 END

    <Log:Tinybldwin 1.98="">


    piccodes.ini
    $39, B, 10F 322, $400, $000,


    Rcv:type=39h=9
    K found
    Found:10F 322
    Also found:
    EEprom:
    Config:
    Prepare16FPre - check HEX and GOTO
    WARNING: PCLATH not fully initialised before GOTO! ... could not repair !!!,
    Maybe you sould use some directive in your compiler to enable the use of bootloaders
    Reallocate to [002F8h..002FFh] (byte addr)
    Prepare16FAfter - 0>+Goto 0180
    Addr(words)=000000h, 3+64+1 bytes:
    00 00 40 01 30 8A 00 80 29 04 28 04 28 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 3A
    Sent:68
    wait for a byte max 350 ms
    Received "K": Ok
    Addr(words)=000160h, 3+64+1 bytes:
    01 60 40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 01 30 E0 00 00 00 04 28 5A
    Sent:68
    wait for a byte max 350 ms
    Received "K": Ok
    Flashwrite ok
    no eeprom to write
    WRITE OK at 9:50, time:0.375 sec

    <TinyPicBootloader+(v0.6.2)>


    piccodes.ini
    $39, B, 10F 322, $400, $000, 232, 32,


    Open file: C:\picasm1\10f322_test_board\BLCheck\reg_dump.HEX
    Open COM1 serial port
    Check PIC...
    Software reseting PIC
    Found: 10F 322
    Hex file verified, OK
    WARNING: pclath not fully initialised before GOTO! ...
    WARNING: first 4 words of code could not be fixed
    Maybe you should use some directive in your compiler
    to enable the use of bootloaders
    minMemPos=00000000, maxMemPos=00000320, blockSize=32
    first 4 words at address 0x018C:
    0xFFFF
    0xFFFF
    0xFFFF
    0xFFFF
    Transfering file...
    write mem pos: 0x00000000
    send: EEADRH=0x00, EEADRL=0x00, block=32
    1F 30 8A 00 A0 2F 04 28 04 28 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    CRC OK
    Transfert successfull :-)
    Close COM1 serial port


     
  • Dan

    Dan - 2013-04-11

    Upper Log:Tinybld 1.98
    Lower Log:TinyPicBootloader+ (v0.6.2)

     
  • Dan

    Dan - 2013-04-11

    There was a mistake in the report on the.
    This was correctly

    $39, B, 10F 322, $400, $000, 264, 32,

    Result of type C.

    $39, C, 10F 322, $400, $000, 264, 32,

    Open file: C:\picasm1\10f322_test_board\BLCheck\reg_dump.HEX
    Open COM1 serial port
    Check PIC...
    Software reseting PIC
    Found: 10F 322
    Error: Hex file for PIC16F, PIC family mismatch.
    Close COM1 serial port

     
  • edorul

    edorul - 2013-04-11

    Hello Dan,

    Thanks for your detailed bug report! I'll try to understand the problem.

    But, in the meantime can you try to bootload your test program with:
    $39, C, 10F 322, $400, $000, 264, 32,
    To avoid the "Hex file for PIC16F, PIC family mismatch" error, you must uncheck "Check File" in the lower left of "tiny PIC Bootloader +" window.
    Then can you post the log?

    Best regards,
    Edorul

     
  • edorul

    edorul - 2013-04-11

    Forget my previous post as it was a bad idea to use "C" family! In addition to "high byte address" and "low byte address", it send an "upper byte address" that is not handled in your PIC10F322 firmware. Sorry.

     
  • edorul

    edorul - 2013-04-11

    May be I've found a fix to your problem.
    Can you try the new version attached to this post?

     
  • Dan

    Dan - 2013-04-11

    Dear Edorul.

    Thank you for your quick response.
    I've tried today.

    Program written to the bootloader is activated.
    However, the code of 0x0003 and 0x0001 is incorrect.
    (Code that is written from the bootloader. Jumping to ghost address.)
    Correct assembler code is written as follows.
    Thank you for your quick response.

    0x0001 MOVLW (maxMemPos/2)>>8

    Mem[0]=(maxMemPos/2)>>8 ;Upper of (maxMemPos/2),Bank=0
    Mem[1]=0x30

    0x0003 GOTO maxMemPos/2

    mem[4}=(maxMemPos/2)<<8 ;Lower of (maxMemPos/2),Bank=0
    mem[5}=0x28+((maxMemPos/2)>>8) ;Upper of (maxMemPos/2),Bank=0

    Log:

    Open file: C:\picasm1\10f322_test_board\BLCheck\reg_dump.HEX
    Open COM1 serial port
    Check PIC...
    Software reseting PIC
    Found: 10F 322
    Hex file verified, OK
    WARNING: pclath not fully initialised before GOTO! ...
    WARNING: first 4 words of code could not be fixed
    Maybe you should use some directive in your compiler
    to enable the use of bootloaders
    minMemPos=00000000, maxMemPos=00000300, blockSize=32
    first 4 words at address 0x017C:
    0x3001
    0x00E0
    0x0000
    0x2804
    Transfering file...
    write mem pos: 0x00000000
    send: EEADRH=0x00, EEADRL=0x00, block=32
    1F 30 8A 00 80 2F 04 28 04 28 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    CRC OK
    write mem pos: 0x000002E0
    send: EEADRH=0x01, EEADRL=0x70, block=32
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 01 30 E0 00 00 00 04 28
    CRC OK
    Transfert successfull :-)
    Close COM1 serial port


     
  • Dan

    Dan - 2013-04-11

    Mistake!

    0x0000 and 0x0002.

     
  • edorul

    edorul - 2013-04-11

    Hello!
    Can you test this new version (source included, so you can do some tests)?
    I've just changed picMem[0] from the previous version I've sent you :

    // GOTO to bootloader location
    // adding movlw 0x1F
    //(page of the end of the flash memory)
    picMem[0] = (byte)((selectedPicInfos.maxMemPos / 2) >> 8); // 0x1F; 
    picMem[1] = 0x30;
    // adding  movwf pclath 
    picMem[2] = 0x8A;
    picMem[3] = 0x00;
    // adding goto (2k words - selectedPicInfos.bootloaderSize/2 + 4) words
    // (if page has less than 2k words, there's a roll over in PIC mem structure)
    // goto k -> 10 1kkk kkkk kkkk 
    gotoAsmAddress = 0x2800 + 2048 - selectedPicInfos.bootloaderSize/2 + 4;
    picMem[5] = (byte)((gotoAsmAddress >> 8) & 0xFF);
    picMem[4] = (byte)(gotoAsmAddress & 0xFF);
    

    I hope it will be OK! Else we'll have to change the '2048' in "gotoAsmAddress" calculation...

     
  • Dan

    Dan - 2013-04-12

    Dear Edorul.

    Thank you for the support of many.

    if page has less than 2k words, there is a roll over in PIC mem structure.

    Well noted.

    Bootloader is operating normally.

    Thank you very much.

    I was really looking forward love this little bootloader,
    I expect someone to publish the source codes.

    TinyPicBootloader+ really, really like the usability is better than tinybld2 and pytbl.

    I am grateful to be a part of this project.

    Do I have to answer some questions from you?

    Finally, I thank You for that dating in my poor English.

     
  • edorul

    edorul - 2013-04-12

    Hello Dan,

    Thanks a lot for your feedback! I'm happy it's working!!!

    As you, I love "Tiny Bootloader" from Claudiu Chiculita. But, I wanted to add PIC32MX family so I wrote mine based on "Tiny Pic Bootloader for GNU/Linux" writen in python by Ferezvi. By this way, I can now add every features I want... or in this case you want ;-)

    Indeed, I've got some questions:
    1) did you need to change source code from my previous post to achieve your PIC10F322 working?
    2) why are you using your firmware with 132 words long and not the one with 100 words?
    3) what is the usefulness in your firmwares of "#define Direct", "#define Direct_TX" and "#define Direct_RX" options?
    4) can I add your firmware in the next version of "Tiny PIC Bootloader +"?
    5) why do you use PIC10F322 devices and not, for example, PIC12F617?

    Best regards,
    Edorul

     

    Last edit: edorul 2013-04-12
  • Dan

    Dan - 2013-04-12

    Dear Edorul.

    I will respond.

    A1,2
    Know the existence of your source code,
    I challenge the bootloader of 96 words I thought I'd be.

    PIC10F322's program area is very small,
    because This is because when bootloader loading,
    you want to ensure the program area and many more.

    I have used mainly assembler,
    132 bytes of 512 bytes is a very strict.

    Then, PCLATH course also exists PIC10F233,
    It does not matter bootloader's operation.

    Unlike the initial baseline PIC,
    PIC10F322 instruction because of the "CALL" and "GOTO" instructions
    Access and can be anywhere in a 512 words,
    and in Bootloader, "ADDWF PCL" or "MOVWF PCL" is not being used.

    Respect PIC10F322 is the unnecessary processing of
    the first four words of the above reasons.

    0x01 fixed to the outlet of the bootloader,
    and do not rewrite the last four words,
    It can maximize the space program.

    I have to change the source code of the host for this purpose.

    Boot loader of 96 words is quite impossible to write code.
    For example, if the host does not send me the word data at 16,
    this does not work.
    TMR2 is also self-propelled as TMR0.
    96 word version of the Troubleshooting the program capacity.
    That is one option.

    Although more stable version of 132 words,
    the assumption (32 words) transfers in Tinybldwin
    Now that you have created,
    it is used as a RAM register PWM, NCO and TMR2.

    Placing them in the RAM of your options thanks I was enabled.

     
  • Dan

    Dan - 2013-04-12

    I will respond.

    A3

    Direct indicates the method to be connected directly to the serial port
    divided by the resistor and diode.

    If you comment out the Direct,
    we assume the input and output of the inverted signal.
    This is the case if you are using, such as MAX232 as a driver.
    If you want to connect to each other, such as connecting PIC to PIC with USB,
    not used Direct. (PIC will use the UART.)
    Direct if not used in a transistor circuit to invert the signal in a circuit using a resistor and diode.

    Initially I was using the Direct also one of the RX also TX,
    when I tested the connection with 16FUSB It is necessary to invert only the signal RX,
    I am using the TX and RX separately from it.

    (Subroutine in the bootloader of the 132 words can be called from the user program.)

     
  • Dan

    Dan - 2013-04-12

    I will respond.

    A4

    It is OK. Please feel free to use me.
    I'd like to say, and It is in English and follow the indications look terrible.
    I can not support sufficient and appropriate.
    Sorry to trouble you, but I can take care.
    I would like to follow. You can provide both the final version.

    However, is there demand.
    I have changed and that this could be just me?

     
  • Dan

    Dan - 2013-04-12

    I will respond.

    A5

    I will also use, for example, PIC16F1823, PIC18F14K and PIC12F1822,

    PIC10F322 I like particularly.

    It is a reason,

    1.Very high Cost performance.

    2.Feature rich.

    3.There is no paging, program efficiency is good.

    4.I believe there is a lot that can be any I / O 4-pin only.

    5.It is just good to me at the end that can only be assembler.

     
  • edorul

    edorul - 2013-04-12

    Hello Dan,

    Thanks a lot for yours answers!
    I'm curious to try your firmware, so I'll get some PIC10F322 ;-)

    Best regards,
    Edorul

     
  • Dan

    Dan - 2013-04-12

    Dear Edorul.

    Thank you.

    !! Changes to the final version !!

    Source program that they offered to the destination (96/132)
    Please change the following.

    1. 96wors version

    ;clrf ANSELA ;digital I/O

    ->
    clrf ANSELA ;digital I/O

    movlw buffer ;FSR=RAM TOP
    movwf FSR
    writeloop:

    ->
    bcf FSR,5 ;FSR=RAM TOP
    writeloop:

    2.100words version

    In addition to the above changes

    goto User_Program ;timeout:exit in all other cases

    ->
    goto first_address ;timeout:exit in all other cases

    3.132words version

        cblock 0x40
        buffer:64
        endc
    

    crc equ TMR2 ;8bit 0x0011
    contor equ PWM2DCH ;8bit 0x0018
    i equ PWM1DCH ;8bit 0x0015
    cnt1 equ NCO1ACCU ;4bit 0x0029
    cnt2 equ NCO1ACCH ;8bit 0x0028
    cnt3 equ NCO1ACCL ;8bit 0x0027
    cn equ cnt1
    rs equ cnt2
    rxd equ cnt3

    ->
    cblock 0x40
    buffer:32
    endc

        cblock 0x77
    crc     ;0x77
    contor      ;0x78
    i       ;0x79
    cnt1        ;0x7A
    cnt2        ;0x7B
    cnt3        ;0x7C
    cn      ;0x7D
    rs      ;0x7E
    rxd     ;0x7F
        endc
    

    The external reference subroutine in 132words version.
    bwait equ 0x01E8 ;Wait 100us(With in CALL)
    bwait2 equ 0x01E9 ;Wait 50us (With in CALL)
    rs1tx equ 0x01D9 ;Send 1byte
    rs1rx equ 0x01C3 ;Recive 1byte
    rs1rxc equ 0x01D5 ;Recive 1byte (No wait Start bit Arrival)
    r1rx11 equ 0x01C5 ;Recive 1byte(After Start bit Arrival)
    rd equ 0x01EE ;Read flash
    wr_e equ 0x01F3 ;Erase flash(16words)
    wr_w equ 0x01F5 ;Write flash(1word)

    If if is with reference to the circuit of My Page,
    please check the pin assignment of the RX and TX.
    In My Page, It has become the RX = 1 and TX = 0.

     
  • edorul

    edorul - 2013-04-13

    Hello Dan.

    Thanks a lot for the latest version of your firmwares :-)
    But can you zip your firmwares and post them as a file attachment? I would be easier, as for now your firmwares are on two different treads an may be five different posts in this forum ;-) Moreover, code highlighting with sourceforge's forum is very poor :-(

    Best regards,
    Edorul

     
  • Dan

    Dan - 2013-04-13

    Dear Edorul.

    I'm sorry.

    The Please feel free to after.

    Thanks a lot.

     

    Last edit: Dan 2013-04-13
  • Dan

    Dan - 2013-04-13

    And This.

     
  • edorul

    edorul - 2013-04-13

    Hello Dan,

    It's great, thanks a lot!!!!!
    I'll try it when I'll receive my PIC10F322 ;-)

    Best regards,
    Edorul

     
  • Dan

    Dan - 2013-04-14

    Dear Edorul.

    It may have been offended by the modified source without permission.
    I am very much rude.
    I wrote the following postscript to my page.

    So do not decide to get offended if.

    Added the 15th April 2013

    Where I asked Mr.Edorul is a developer of TinyPicBootloader+,
    corresponding to (16 words) transfer 32 bytes from TinyPicBootloader+ (v0.6.3) willingly.

    Because it is compatible with tinybldwin traditional,
    it can be used in unmodified from (v0.6.3).

    Please add the following description to piccodes.ini When (v0.6.3) use.

    $3X, B, 10F 322, $ 400, 0, default, 32,

    $3X the device number assigned to the firmware
    (The number has been assigned by icdpictypes.inc when compiling the firmware)

    The case of (v0.6.3) use is the source of the firmware presented in the previous page.

    Please change as follows.

    way_to_exit:
    goto User_Program; timeout: exit in all other cases

    (After the change)
    goto first_address; timeout: exit in all other cases

    Operation of the bootloader by the above changes,
    It becomes the reset → Tinybld timed out → address 0x019C.

    When writes in (v0.6.3) TinyPicBootloader+,
    tinybldwin same Code of 0x00 ~ 0x03 of HEX file to be transferred first to move to 0x019c ~ 0x019f,

    Jump code to the boot loader is written in the area of 0x00 ~ 0x03.

    In other words, when you write a what HEX file,
    and boot loader always firstMechanism to jump to are provided.

    HEX file that you create to fit the size of 512-100 bytes
    While it is best if you create, but there is one caveat.

    It shall describe the jump to the executable code to HEX file first four wordThe goal is to not go. (Such as goto START goto INIT such as, for example)

    If you do not address the jump to the executable code to HEX file first four word,
    As mentioned earlier, code of 0x00 ~ 0x03 of HEX file to 0x019c ~ 0x019fBecause you move, at the exit of the boot loader to Tinybld after a timeout,Causing programs to get lost.

    It is a quest for one of the methods when placing PIC10F322's bootloader,
    expand the program area,
    the topic being introduced in (1) the previous page and (2) This page
    is different from the thought of Tinybld the original I also leave
    the refuse that there is no compatibility.

     
  • edorul

    edorul - 2013-04-14

    Hello Dan,

    There is no problem! You can modify and share "Tiny PIC Bootloader +" the way you like :-)
    Even more i'm glad you do this ;-)

    Best regards,
    Edorul

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.