Particle Dev VS Particle Build IDE Compile Issues

Can someone please explain why Particle Dev & the Build IDE compile so differently?

I have been working exclusively with Particle Dev. I know later I would like to post it publicly at some point soon so I thought I would copy the project files (which compile with no errors or warnings using Particle Dev). to the online IDE compiler. When I did I was hit with many warnings & errors. Some are silly warnings like when I would use uint32_t.

At this point I have no idea why one would be different than the other, and now questioning which one I should have been using all along.

Particle, PLEASE for the love of GOD can you come out with some typical setup to build locally. In that I mean YOU particle produce it as a download and install application. What you have is ok, but Who really wants to have their code stored in the cloud and create copies of the code to have locally? Particle Dev is a great improvement, but it seriously lacks the typical programming environment for programmers such as function lookup, and many many other things that are included with IDE’s like Eclipse or netbeans. We also need to know how much flash we are consuming with our code. Currently neither the online IDE or PD does this, so we have no way of knowing how close to the wall we are.

A local Build application that we can just install on our PC’s and it will keep track of latest build files, and update to them as well when needed. With the option in it to flash the board using either the micro USB cable or over the air using: particle flash 21xxxxxxxxxxxxxxxxxx3338 myapp.bin

This would make the whole process so much better for all the users I think.

Just some thoughts on this:
I get where you’re coming from, and I too would welcome a plug&play solution. That said, I believe they’re already working on something like that, so it might just take a bit of patience :smile:

In the mean time, this might be something that interests you. That should install an entire offline toolchain, which you can use as you please:

I think it’s not really reasonable to expect Particle to release a full-fledged IDE, since that’s not their main business. There are companies out there that exist solely for developing an IDE. Added to that comes the fact that not everyone likes to use the same IDE. Some folks like eclipse, some VS, some netbeans, and so on. You couldn’t possible satisfy them all with a single IDE, and therefore I’d argue that effort is better spent elsewhere. That’s not to say that the IDE’s Particle has shouldn’t work, but perhaps shouldn’t be as feature-packed as some of the big ones out there.

Try clicking the ‘ready’ at the bottom after verifying. It should show you the size.

Moors7, yes you are right. I just let my frustration get the best of me in the post, sorry guys.
There are so many people who love different IDE’s It would be hard.
When you start creating projects that are large and have several source and header files, the features of the other IDE’s really come in super handy.

Thanks for that link, I was actually downloading it while I was writing this post.
hopefully, Mr. mumblepins will keep that updated as the firmware changes.
I just feel better when the actual company creates something like what he did then you’re oretty sure its kept updated.

Don’t worry about it. Like I said, I get where you’re coming from.
There are general instructions available on how to set up your own toolchain, but those can be a bit hard to follow it you haven’t ever done something like that before. That’s where Particle Dev is nice. It’ll get you started, and let’s you do the basic things. Prior to that is the Web IDE which is even simpler. You can also compile using the CLI, thus using your own editor. Finally, there’s local compile, in which you set up your own preferred tool chain. By the time you get there, it’s reasonable to expected one to be a bit more familiar with the operation of these kinds of environments, since local compile is rather advanced.

I’m lobbying for it :wink:

Most of your points have been covered and I’m with you and @Moors7 that :particle: IDEs need a major overhaul and Particle is at it right now, but I’d like to address the actual point of the topic and the above quote.

Can you give some more info what kind of errors/warnings you get on Build that you aren’t getting on Dev?
It might be a very simple adaption to get Build to do what Dev already does for you.

I created the same files names from my local sources to the IDE and then copied and pasted into each file. I built them again in Particle Dev just before doing this, reported back with “Success!” after build.
I also use the link by @Moors7 to compile locally and it too compiled with no errors or warnings.

Where as the IDE came back with all these errors.

In file included from application.cpp:2:0:

Upload.h:7:1: error: 'uint32_t' does not name a type
 uint32_t GetData(uint32_t start, boolean save_it);
 ^


In file included from application.cpp:5:0:

SST25VF016B.h:29:1: error: 'boolean' does not name a type
 boolean sFLASH_Init(void);
 ^


SST25VF016B.h:30:25: error: variable or field 'sFLASH_EraseSector' declared void
 void sFLASH_EraseSector(int32_t SectorAddr);
                         ^


SST25VF016B.h:30:25: error: 'int32_t' was not declared in this scope

SST25VF016B.h:32:49: error: 'int32_t' has not been declared
 void sFLASH_WriteBuffer(unsigned char *pBuffer, int32_t WriteAddr, int32_t NumByteToWrite);
                                                 ^


SST25VF016B.h:32:68: error: 'int32_t' has not been declared
 void sFLASH_WriteBuffer(unsigned char *pBuffer, int32_t WriteAddr, int32_t NumByteToWrite);
                                                                    ^


SST25VF016B.h:33:23: error: variable or field 'sFLASH_WriteByte' declared void
 void sFLASH_WriteByte(int32_t WriteAddr, unsigned char value);
                       ^


SST25VF016B.h:33:23: error: 'int32_t' was not declared in this scope

SST25VF016B.h:33:42: error: expected primary-expression before 'unsigned'
 void sFLASH_WriteByte(int32_t WriteAddr, unsigned char value);
                                          ^


SST25VF016B.h:34:48: error: 'int32_t' has not been declared
 void sFLASH_ReadBuffer(unsigned char *pBuffer, int32_t ReadAddr, int32_t NumByteToRead);
                                                ^


SST25VF016B.h:34:66: error: 'int32_t' has not been declared
 void sFLASH_ReadBuffer(unsigned char *pBuffer, int32_t ReadAddr, int32_t NumByteToRead);
                                                                  ^


SST25VF016B.h:36:1: error: 'uint8_t' does not name a type
 uint8_t sFLASH_ReadByte( int32_t ReadAddr);
 ^


SST25VF016B.h:37:1: error: 'int32_t' does not name a type
 int32_t sFLASH_ReadID(void);
 ^


SST25VF016B.h:39:48: error: 'int32_t' has not been declared
 void sFLASH_WriteBytes(unsigned char *pBuffer, int32_t WriteAddr, int32_t NumByteToWrite);
                                                ^


SST25VF016B.h:39:67: error: 'int32_t' has not been declared
 void sFLASH_WriteBytes(unsigned char *pBuffer, int32_t WriteAddr, int32_t NumByteToWrite);
                                                                   ^


SST25VF016B.h:43:1: error: 'boolean' does not name a type
 boolean sFLASH_SelfTest(void);
 ^


In file included from application.cpp:8:0:

MI0283QT-9A.h:15:69: error: 'uint16_t' has not been declared
 void LCD_String(char *lcd_string,  long unsigned int *font_pointer, uint16_t ux, uint16_t uy, uint8_t char_spacing, uint16_t fcolor, uint16_t bcolor);
                                                                     ^


MI0283QT-9A.h:15:82: error: 'uint16_t' has not been declared
 void LCD_String(char *lcd_string,  long unsigned int *font_pointer, uint16_t ux, uint16_t uy, uint8_t char_spacing, uint16_t fcolor, uint16_t bcolor);
                                                                                  ^


MI0283QT-9A.h:15:95: error: 'uint8_t' has not been declared
 void LCD_String(char *lcd_string,  long unsigned int *font_pointer, uint16_t ux, uint16_t uy, uint8_t char_spacing, uint16_t fcolor, uint16_t bcolor);
                                                                                               ^


MI0283QT-9A.h:15:117: error: 'uint16_t' has not been declared
 void LCD_String(char *lcd_string,  long unsigned int *font_pointer, uint16_t ux, uint16_t uy, uint8_t char_spacing, uint16_t fcolor, uint16_t bcolor);
                                                                                                                     ^


In file included from application.cpp:8:0:

MI0283QT-9A.h:15:134: error: 'uint16_t' has not been declared
 void LCD_String(char *lcd_string,  long unsigned int *font_pointer, uint16_t ux, uint16_t uy, uint8_t char_spacing, uint16_t fcolor, uint16_t bcolor);
                                                                                                                                      ^


make[1]: *** [../build/target/user/platform-6application.o] Error 1
make: *** [user] Error 2

Ready.

How are you including application.h in all your source files?

Especially your main project file, is it an .INO file and are you using #pragma SPARK_NO_PREPROCESSOR in it or not?
Could you post your main project file (at least the declaration part of it)?
And maybe also one short header file that throws an error too?

Here is the top portion of the application.ino file (see below)
The thing is, In App Dev my main file is a .c file, but the WEB IDE wont let me get rid of the .ino file. So I just copied and pasted the code in the .ino file. I am not using #pragma SPARK_NO_PREPROCESSOR.

At the very bottom is one of the header files.

    #include "application.h"
    #include "stdarg.h"
    #include "headers.h"
    #include "MI0283QT-9A.h"
    #include "SST25VF016B.h"
    #include "Upload.h"
    #include "Comic_Sans.h"
    #include <stdio.h>
    #include <string.h>

    //https://docs.particle.io/reference/firmware/photon/#semi-automatic-mode
    // This is done so we initialize the system quickly so user does not think its
    // dead while it waiting to register, or it it has not been registered yet.
    SYSTEM_MODE(SEMI_AUTOMATIC);
    
    //*********************************************************************
    //*********************************************************************
    void setup()
    {
      ...
    /* SST25 SPI Flash supported commands */
    #define sFLASH_CMD_RDSR                    0x05        /* Read Status Register */
    #define sFLASH_CMD_WRSR                    0x01        /* Write Status Register */
    #define sFLASH_CMD_EWSR                    0x50        /* Write Enable Status */
    #define sFLASH_CMD_WRDI                    0x04        /* Write Disable */
    #define sFLASH_CMD_WREN                    0x06        /* Write Enable */
    #define sFLASH_CMD_READ                    0x03        /* Read Data Bytes */
    #define sFLASH_CMD_WRITE                 0x02        /* Byte Program */
    #define sFLASH_CMD_AAIP                 0xAD        /* Auto Address Increment */
    #define sFLASH_CMD_SE                     0x20        /* 4KB Sector Erase instruction */
    #define sFLASH_CMD_BE                     0xC7        /* Bulk Chip Erase instruction */
    #define sFLASH_CMD_RDID                    0x9F        /* JEDEC ID Read */
    #define sFLASH_CMD_EBSY                 0x70        /* Enable SO RY/BY# Status */
    #define sFLASH_CMD_DBSY                 0x80        /* Disable SO RY/BY# Status */
    
     #define sFLASH_WIP_FLAG                   0x01        /* Write In Progress (WIP) flag */
    
    #define sFLASH_DUMMY_BYTE                 0xFF
    #define sFLASH_PAGESIZE                    0x1000        /* 4096 bytes */
    
    #define sFLASH_SST25VF040_ID            0xBF258D    /* JEDEC Read-ID Data */
    #define sFLASH_SST25VF016_ID            0xBF2541    /* JEDEC Read-ID Data */
    
     
    #define sFLASH_CS(x) digitalWriteFast(FLASH_CS_PIN, x)
    
    /* High level functions. */
    boolean sFLASH_Init(void);
    void sFLASH_EraseSector(int32_t SectorAddr);
    void sFLASH_EraseBulk(void);
    void sFLASH_WriteBuffer(unsigned char *pBuffer, int32_t WriteAddr, int32_t NumByteToWrite);
    void sFLASH_WriteByte(int32_t WriteAddr, unsigned char value);
    void sFLASH_ReadBuffer(unsigned char *pBuffer, int32_t ReadAddr, int32_t NumByteToRead);
    //unsigned char sFLASH_ReadBuffer( int32_t ReadAddr);
    uint8_t sFLASH_ReadByte( int32_t ReadAddr);
    int32_t sFLASH_ReadID(void);
    
    void sFLASH_WriteBytes(unsigned char *pBuffer, int32_t WriteAddr, int32_t NumByteToWrite);
    void sFLASH_WriteEnable(void);
    void sFLASH_WriteDisable(void);
    void sFLASH_WaitForWriteEnd(void);
    boolean sFLASH_SelfTest(void);

OK, some points that might make a difference.

Since you are originaly using a .C file (originally only .CPP was supported, so it might be safer to have all files as .CPP/.H) you might want to add the #pragma SPARK_NO_PREPROCESSOR in your .INO file to have the proprocessor treat it like a standard C file.
And Particle Dev does also accept one .INO file as main project file, so for consistence use that extention and the #pragma for both IDEs.

Next, the Web IDE is known to have problems with #include <...>, so try to convert this into #include "...", which should work for all IDEs.

I’ve added a break between the main snippet and the header - I hope I’ve set it right there.

Scruff, my appolgies typing to dam fast. My original file is a .cpp file in App dev.
I will try your suggestions and see what happens.

1 Like

It compiling now online, Thank you for the time.

2 Likes