Author Topic: NHD-4.3CTP-Shield -- Hello world example compilation fails  (Read 1961 times)

Tim_Cole

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
NHD-4.3CTP-Shield -- Hello world example compilation fails
« on: October 22, 2016, 01:18:40 AM »
Greeting folks
It looks like I've fixed my library installation finger trouble, which has moved me ahead to another problem. I've started with the venerable "Hello, world" example. Compiling produces the following errors, copied from the IDE with the "Copy error messages" button.

Help!

----


Arduino: 1.6.12 (Windows 10), Board: "Arduino/Genuino Uno"

WARNING: Category '' in library OneWire is not valid. Setting to 'Uncategorized'
In file included from C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/FT_NHD_43CTP_SHIELD.h:67:0,

                 from C:\Program Files (x86)\Arduino\libraries\FTDI_FT801\examples\FT_NHD_43CTP_SHIELD\Basic\HelloWorld\HelloWorld.ino:30:

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_Transport_SPI/FT_Transport_SPI.h:215:37: error: 'prog_uchar' has not been declared

  void Writefromflash(uint32_t Addr, prog_uchar *Src, uint32_t NBytes)

                                     ^

In file included from C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/FT_NHD_43CTP_SHIELD.h:68:0,

                 from C:\Program Files (x86)\Arduino\libraries\FTDI_FT801\examples\FT_NHD_43CTP_SHIELD\Basic\HelloWorld\HelloWorld.ino:30:

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:330:32: error: 'prog_uchar' has not been declared

  FT_GEStatus WriteCmdfromflash(prog_uchar *Src,uint32_t NBytes);

                                ^

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:334:35: error: 'prog_uchar' has not been declared

  FT_GEStatus TransferCmdfromflash(prog_uchar *Src,uint32_t NBytes);

                                   ^

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:372:71: error: redeclaration of 'FT_Status FT_GC<FT_Trans>::Init(uint8_t, uint16_t)' may not have default arguments [-fpermissive]

 FT_Status FT_GC<FT_Trans>::Init(uint8_t ResType, uint16_t options1 = 0)

                                                                       ^

In file included from C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/FT_NHD_43CTP_SHIELD.h:68:0,

                 from C:\Program Files (x86)\Arduino\libraries\FTDI_FT801\examples\FT_NHD_43CTP_SHIELD\Basic\HelloWorld\HelloWorld.ino:30:

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:410:258: error: redeclaration of 'FT_Status FT_GC<FT_Trans>::Init(uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint8_t, uint8_t, uint8_t, uint16_t)' may not have default arguments [-fpermissive]

 FT_Status FT_GC<FT_Trans>::Init(uint16_t hperiod,uint16_t vperiod,uint16_t hfrontporch,uint16_t hbackporch,uint16_t hpulsewidth,uint16_t vfrontporch,uint16_t vbackporch,uint16_t vpulsewidth,uint8_t polarity,uint8_t swizzle,uint8_t fps, uint16_t options1 = 0)

                                                                                                                                                                                                                                                                  ^

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:1670:52: error: 'FT_GEStatus FT_GC<FT_Trans>::TransferCmdfromflash' is not a static member of 'class FT_GC<FT_Trans>'

 FT_GEStatus FT_GC<FT_Trans>::TransferCmdfromflash( prog_uchar *Src,uint32_t NBytes)

                                                    ^

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:1670:52: error: template definition of non-template 'FT_GEStatus FT_GC<FT_Trans>::TransferCmdfromflash'

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:1670:52: error: 'prog_uchar' was not declared in this scope

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:1670:64: error: 'Src' was not declared in this scope

 FT_GEStatus FT_GC<FT_Trans>::TransferCmdfromflash( prog_uchar *Src,uint32_t NBytes)

                                                                ^

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:1670:77: error: expected primary-expression before 'NBytes'

 FT_GEStatus FT_GC<FT_Trans>::TransferCmdfromflash( prog_uchar *Src,uint32_t NBytes)

                                                                             ^

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:1780:49: error: 'FT_GEStatus FT_GC<FT_Trans>::WriteCmdfromflash' is not a static member of 'class FT_GC<FT_Trans>'

 FT_GEStatus FT_GC<FT_Trans>::WriteCmdfromflash( prog_uchar *Src,uint32_t NBytes)

                                                 ^

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:1780:49: error: template definition of non-template 'FT_GEStatus FT_GC<FT_Trans>::WriteCmdfromflash'

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:1780:49: error: 'prog_uchar' was not declared in this scope

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:1780:61: error: 'Src' was not declared in this scope

 FT_GEStatus FT_GC<FT_Trans>::WriteCmdfromflash( prog_uchar *Src,uint32_t NBytes)

                                                             ^

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT_GC.h:1780:74: error: expected primary-expression before 'NBytes'

 FT_GEStatus FT_GC<FT_Trans>::WriteCmdfromflash( prog_uchar *Src,uint32_t NBytes)

                                                                          ^

In file included from C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/FT_NHD_43CTP_SHIELD.h:69:0,

                 from C:\Program Files (x86)\Arduino\libraries\FTDI_FT801\examples\FT_NHD_43CTP_SHIELD\Basic\HelloWorld\HelloWorld.ino:30:

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT801/FT801Impl.h:124:73: error: redeclaration of 'FT_Status FT801Impl<FT_Trans>::Init(uint8_t, uint16_t)' may not have default arguments [-fpermissive]

 FT_Status FT801Impl<FT_Trans>::Init(uint8_t ResType, uint16_t options1=0)

                                                                         ^

C:\Program Files (x86)\Arduino\libraries\FTDI_FT801/libraries/FT_GC/FT801/FT801Impl.h:133:71: error: redeclaration of 'FT_Status FT801Impl<FT_Trans>::Init(uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint8_t, uint8_t, uint8_t, uint16_t)' may not have default arguments [-fpermissive]

       uint8_t polarity,uint8_t swizzle,uint8_t fps,uint16_t options1=0)     

                                                                       ^

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 248
  • Karma: 16
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #1 on: October 24, 2016, 08:05:10 AM »
Morning Tim,

Can you please try installing version 1.0.6 of the Arduino IDE?

https://www.arduino.cc/en/Main/OldSoftwareReleases

It appears there was a change in the syntax, I'll look into this change further and provide a fix.


Tim_Cole

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #2 on: October 24, 2016, 03:33:01 PM »
I'll give it it a shot on a laptop I don't normally use for programming. Call me paranoid, but I don't want to muck up my existing setup.

Tim_Cole

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #3 on: October 28, 2016, 02:11:34 AM »
Okay, I just installed the Arduino 1.0.6 IDE on my laptop, installed the FTDI 800/801 library and compiled the HelloWorld example. That worked properly. So, something got broken between 1.0.6 and 1.6.12.

Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 248
  • Karma: 16
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #4 on: October 28, 2016, 08:08:16 AM »
Glad to hear you are up and running! The library was originally written with the old IDE, and since then the avr-gcc compiler has changed and certain keywords/datatypes give errors in the new Arduino IDEs.


Tim_Cole

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #5 on: October 28, 2016, 03:06:18 PM »
Gotta love changes that break existing code....

ThomasLenz

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #6 on: February 08, 2017, 08:36:43 PM »
Hello,
i just got my new NHD-4.3-Shield-Display, loaded the FTDI-801-Library into the actual
Arduino-IDE and get the same errors as Tim_Cole in every single demo-program.
Where can I find the correct 801-library fr the actual Arduino-IDE ?
Downgrading to an old IDE (1.0.6) is not an accaptable solution.

Best regards,
Thomas

Tim_Cole

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #7 on: February 13, 2017, 12:03:04 AM »
I've looked over the FTDI website and found nothing. As nearly as I can tell, a major revision to the GCC-AVR compiler broke this code after 1.5.6.

There doesn't seem to be a solution from FTDI, and it would appear that Newhaven is doing little more than repackaging the FTDI code.  This isn't a good situation, and I'm annoyed with the lack of response.

Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 248
  • Karma: 16
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #8 on: February 13, 2017, 09:18:02 AM »
Morning Tim,

Im sorry to hear about the trouble you are having with the FTDI_FT80x library. As stated previously the FT80x library was originally written with the old IDE, and since then the avr-gcc compiler has changed and certain keywords/datatypes give errors in the new Arduino IDEs. We are in the process of updating the library and will be putting in a pull request soon on our GitHub page.

In order to get the code to compile the datatypes will need to be updated to match the new Arduino IDE's syntax.

Example:

Code: [Select]
Old Syntax:
typedef prog_uchar  ft_prog_uchar8_t;
typedef prog_char   ft_prog_char8_t;
typedef prog_uint16_t ft_prog_uint16_t;

New Syntax:
typedef const unsigned char  ft_prog_uchar8_t;
typedef const char   ft_prog_char8_t;
typedef const unsigned int ft_prog_uint16_t;


For your reference I have emailed you an example sketch which I have updated to compile on version 1.6.13.


Tim_Cole

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #9 on: February 13, 2017, 01:04:43 PM »
Hi Paul,
Thanks for this. I got this message via e-mail and downloaded the zip file. I'll look it over later today.
It certainly looks as though updating the syntax is time-consuming and tedious job. You really have to wonder why the avr-gcc gurus didn't provide some kind of backward compatibility switch, even if it resulted in blaring warnings about deprecated features.

Regards, Tim

Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 248
  • Karma: 16
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #10 on: February 28, 2017, 01:01:01 PM »
Please see the updated FTDI_FT800 & FTDI_FT801 libraries available for download now on our GitHub page! The code successfully complies on version 1.8.1

https://github.com/newhavendisplay

Best Regards,

« Last Edit: February 28, 2017, 01:02:40 PM by Paul_B »

Tim_Cole

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: NHD-4.3CTP-Shield -- Hello world example compilation fails
« Reply #11 on: March 26, 2017, 03:58:32 AM »
Thanks very much for this.

 

NHD-4.3xxx-Shield - Vertical Mode

Started by talsitBoard Evaluation Tools

Replies: 2
Views: 1214
Last post May 05, 2017, 01:26:07 PM
by CarlW
NHD-4.3RTP-SHIELD-V Problem

Started by Matt_MBoard Accessories

Replies: 4
Views: 376
Last post August 04, 2017, 01:33:56 PM
by Paul_B
NHD-4.3RTP-SHIELD-N Pinout

Started by skmfgBoard TFTs

Replies: 1
Views: 13
Last post October 17, 2017, 08:31:08 AM
by Paul_B
arduino 101 on nhd-4.3 ctp-shield-n

Started by geraldcBoard TFTs

Replies: 0
Views: 325
Last post June 24, 2017, 10:35:13 PM
by geraldc
NHD-C0220BiZ-FSW-FBW-3V3M fails premature

Started by LeoBoard Character LCDs

Replies: 1
Views: 1849
Last post July 31, 2015, 08:31:45 AM
by Michael_L