Menu

Bug in function Write18FKx

Anonymous
2022-07-01
2022-07-01
  • Anonymous

    Anonymous - 2022-07-01

    I believe that there is a bug in function Write18FKx:

    void Write18FKx(int dim, int dim2, int options, int nu1, int nu2, int nu3)

    "op" reports programming errors, and upon closer inspection these seem
    to be related to "shortcuts" the function is taking by not programming
    0xff bytes.

    This concerns programming the Q43 types:

    Here:

     for (i = k = 0; i < dim; i += 2) {
       if (memCODE[i] < 0xFF || memCODE[i + 1] < 0xFF) {
        ...
    

    This leads to a difference between the i and k counters at the end of
    the write loop.

    This leaves me wondering whether the Q43 writing has actually been tested ?

     
  • Alberto Maccioni

    k is also adjusted in those "shortcut" cases.
    Anyways, a test case is needed to reproduce and solve the issue.
    I did try the algorithm on a 18F27Q43; but it could happen that a different hex file stimulates a different execution path with a so far undetected bug.

     

Anonymous
Anonymous

Add attachments
Cancel





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.