Menu

No HEX file generated - how do I identify ht e problem?

Flotul
2024-11-25
2024-11-26
  • Flotul

    Flotul - 2024-11-25

    Hi,

    This is not about a "compiler" issue but much more likely mine (😁).

    I don't see why no HEX file is generated with my appended test file. I also appended the task manager's logfile.

    BTW, I compiled other programs that did work great so there must be a beam in my eye.

     
  • Flotul

    Flotul - 2024-11-25

    ...and the second file is here.

     
  • Anobium

    Anobium - 2024-11-25

    Thank you.

    The code is not fully ported from the source.

    $ should be 0x and there are many more conversion needed.
    - [] does not work on GCBASIC. These wont work I2CSend SDA,SCL,I2CDevice,[$40,144,96,96,144]

    But, why not just use the GCBASIC SSD1306 GLCD driver ? It will be a lot faster and it will work. None of the following would be need.

    PAUSE 100 ' display settle
    COM = 0xAE : GOSUB SEND_COMMAND ' turn off oled panel
    COM = 0xD5 : GOSUB SEND_COMMAND ' set display clock divide ratio/oscillator frequency
    COM = 0x80 : GOSUB SEND_COMMAND ' set divide ratio
    COM = 0xA8 : GOSUB SEND_COMMAND ' set multiplex ratio
    COM = 0x3F : GOSUB SEND_COMMAND ' 1/40 duty
    COM = 0xD3 : GOSUB SEND_COMMAND ' set display offset
    COM = 0x00 : GOSUB SEND_COMMAND
    COM = 0x20 : GOSUB SEND_COMMAND ' Addressing Setting Command Table
    COM = 0x00 : GOSUB SEND_COMMAND '  " horizontal addressing mode
    COM = 0xAD : GOSUB SEND_COMMAND ' Internal IREF Setting
    COM = 0x30 : GOSUB SEND_COMMAND ' --
    COM = 0x8D : GOSUB SEND_COMMAND ' set Charge Pump enable/disable
    COM = 0x14 : GOSUB SEND_COMMAND ' set(0x10) disable
    COM = 0x68 : GOSUB SEND_COMMAND ' set start line address
    COM = 0xA6 : GOSUB SEND_COMMAND ' set normal display
    COM = 0xA4 : GOSUB SEND_COMMAND ' Disable Entire Display On
    COM = 0xA1 : GOSUB SEND_COMMAND ' set segment re-map 128 to 0
    COM = 0xC8 : GOSUB SEND_COMMAND ' Set COM Output Scan Direction 64 to 0
    COM = 0xDA : GOSUB SEND_COMMAND ' set com pins hardware configuration
    COM = 0x12 : GOSUB SEND_COMMAND '
    COM = 0x81 : GOSUB SEND_COMMAND ' set contrast control register
    COM = 0x7F : GOSUB SEND_COMMAND '
    COM = 0xD9 : GOSUB SEND_COMMAND ' set pre-charge period
    COM = 0x22 : GOSUB SEND_COMMAND '
    COM = 0xDB : GOSUB SEND_COMMAND ' set vcomh
    COM = 0x40 : GOSUB SEND_COMMAND '
    COM = 0x2E : GOSUB SEND_COMMAND ' stop any scrolling
    COM = 0xAF : GOSUB SEND_COMMAND ' turn on oled panel
    

    ..DEMOS\GLCD_Solutions\GLCD_Simple_Demonstration_Solutions\GLCD_Simple_Demonstration_Software_I2C_18F16Q20_for_SSD1306_128_64@16.gcb

    Just rename the chip, change the ports and it should work.

     
  • Anobium

    Anobium - 2024-11-25

    Here is a quick version.

    Clearly the old chip with little RAM has few GLCD capabilities.

     
  • Flotul

    Flotul - 2024-11-26

    Thanks a lot Anobium.

    I'm still discovering GCB and its capacities and it looks really amazing!!!

    I'll definitively use the existing stuff much better written as I, hobbyist, would be able to.

    So I'll give it a try tonight 👍

    Since I gently move from PICBasic as you may have seen, I'm not that aware about the conversions I have to make unless I'm warned by the compiler.

    If I may, I would like to ask about the task manager's window after hitting the F6 key: where would I see the compiling errors I made please?

     
  • Anobium

    Anobium - 2024-11-26

    Of course you can ask. Please do. All questions will improve GCBASIC.

    Below is the error list from build 1444 ( which I have just built ). If you look at your source program errors ( there are many ) then this would help you.

    The compiler was crashing with the large number of parameters passed. The GCBASIC function called I2CSend ( which you are calling ) does not accept those parameters and the compiler simply crashed. In build 1444 there is a new capability to ensure this crash does not happen and a user error message is issued. An example TEST_Oxygen_Sensor_0010.gcb (111): Error: Maximum number of parameters (50) exceeded
    I can send you the new compiler but it may be best to wait for the update to be published.

    So, now the compiler is NOT crashing ( here... ) I can see the errors.

    1. I2CSEND is being called without the correct setup
    2. I2CSEND is being called with incorrect parameters.
    3. Missing labels
    4. The errors from i2c.h are caused by issue #1 above.

    BR

    Evan

    GCBASIC (2024.11.26 (Windows 64 bit) : Build 1444)
    
    Compiling: TEST_Oxygen_Sensor_0010.gcb
    
    Errors have been found:
    
     Error: I2C_CLOCK, or your Defined CONSTANT, is not a valid I/O pin or port
     Error: I2C_DATA, or your Defined CONSTANT, is not a valid I/O pin or port
     TEST_Oxygen_Sensor_0010.gcb (54): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (111): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (121): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (129): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (137): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (145): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (153): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (161): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (169): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (177): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (185): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (188): Error: Syntax Error
     TEST_Oxygen_Sensor_0010.gcb (193): Error: Maximum number of parameters (50) exceeded
     TEST_Oxygen_Sensor_0010.gcb (248): Error: Syntax Error
     i2c.h ** (201): Error: I2C_DATA, or your Defined CONSTANT, is not a valid I/O pin or port (System Include)
     i2c.h ** (209): Error: I2C_CLOCK, or your Defined CONSTANT, is not a valid I/O pin or port (System Include)
     i2c.h ** (371): Error: Incorrect parameters in Set, expected: Set variable.bit status (System Include)
     i2c.h ** (376): Error: I2C_DATA, or your Defined CONSTANT, is not a valid I/O pin or port (System Include)
     i2c.h ** (378): Error: Incorrect parameters in Set, expected: Set variable.bit status (System Include)
     i2c.h ** (382): Error: I2C_CLOCK, or your Defined CONSTANT, is not a valid I/O pin or port (System Include)
     i2c.h ** (401): Error: Incorrect parameters in Set, expected: Set variable.bit status (System Include)
     i2c.h ** (407): Error: I2C_DATA, or your Defined CONSTANT, is not a valid I/O pin or port (System Include)
     i2c.h ** (409): Error: I2C_CLOCK, or your Defined CONSTANT, is not a valid I/O pin or port (System Include)
     i2c.h ** (434): Error: Incorrect parameters in Set, expected: Set variable.bit status (System Include)
     i2c.h ** (436): Error: Incorrect parameters in Set, expected: Set variable.bit status (System Include)
    
    The message has been logged to the file Errors.txt.
    
    Done
    
     
  • Flotul

    Flotul - 2024-11-26

    Below is the error list from build 1444 ( which I have just built ). If you look at your source program errors ( there are many ) then this would help you.

    Thanks Evan.

    Let's wait for the update then 😉

     
    • Anobium

      Anobium - 2024-11-26

      If you are confident with replacing a few files within your installation then I will upload a ZIP for you.

       
  • Flotul

    Flotul - 2024-11-26

    Let's try then

     
    • Anobium

      Anobium - 2024-11-26

      Download the ZIP. Unpack to you gcbasic folder. If when you compile you do not get the build 1444... you did it incorrectly. :-)

      https://1drv.ms/u/s!Ase-PX_n_4cvhYtDUCmkcUMUd_lKEw?e=8O2M90

       
  • Flotul

    Flotul - 2024-11-26

    Okay, works.

    I had to extract the files in the upper-level gcbasic directory cause I have this:
    C:\Program Files (x86)\GCstudio\gcbasic\gcbasic

     
    • Anobium

      Anobium - 2024-11-26

      I would not have installed to Program Files (x86) as this can lead to many issued with 3rd party tools - just be aware for when/if you hit issues.

      Do you get build 1444?
      Do you get the error messages?

       
  • Flotul

    Flotul - 2024-11-26

    I still have some homework to do to convert my PBP code to GCB....

    Meanwhile, thanks a lot for your great support ;-)

     
  • Flotul

    Flotul - 2024-11-26

    I would not have installed to Program Files (x86) as this can lead to many issued with 3rd party tools - just be aware for when/if you hit issues. I saw the original installation in the root and thought it was my bad. I might follow your advice and reinstall from fresh.

    Do you get build 1444? Yes
    Do you get the error messages? Yes, unfortunately but yes, great!

     

    Last edit: Flotul 2024-11-26
  • Anobium

    Anobium - 2024-11-26

    The initial issue of the compiler crash was not good. But, as more people report issues the better the compiler becomes.

    It should not crash. :-) Now you at least get meaningful error messages.

    :-)

     

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.