0

As the title states, I'm trying to use the chipkit core in MPLAB X IDE. I'm doing this because I want to be able to properly debug the PIC32 board that I'm using for this project, but I don't have the time to re-write all of the Arduino/Arduino-alike libraries that the project already uses.

However, when trying to compile, I'm running into issues in the chipkit code (not even my code!). The current error that is stumping me is:

In file included from ../../chipKit_pic32/2.1.0/cores/pic32/noniso.c:25:0:
../../chipKit_pic32/2.1.0/cores/pic32/stdlib_noniso.h:34:5: error: expected identifier or '(' before 'int'
 int atoi(const char *s);
     ^
../../chipKit_pic32/2.1.0/cores/pic32/stdlib_noniso.h:36:6: error: expected identifier or '(' before 'long'
 long atol(const char* s);
      ^
../../chipKit_pic32/2.1.0/cores/pic32/stdlib_noniso.h:38:8: error: expected declaration specifiers or '...' before numeric constant
 double atof(const char* s);
        ^
../../chipKit_pic32/2.1.0/cores/pic32/stdlib_noniso.h:38:8: error: expected declaration specifiers or '...' before numeric constant
 double atof(const char* s);
        ^

I can only assume that I'm missing something dumb, but for the life of me I can't find it.

The file "stdlib_noniso.h" is as follows:

#ifndef STDLIB_NONISO_H
#define STDLIB_NONISO_H

//#define _NEED_REVERSE
//#define _NEED_LTOA
//#define _NEED_ULTOA
#define _NEED_DTOSTRF

#ifdef __cplusplus
extern "C"{
#endif

int atoi(const char *s);

long atol(const char* s);

double atof(const char* s);

char* itoa (int val, char *s, int radix);

#ifdef _NEED_LTOA
char* ltoa (long val, char *s, int radix);
#endif

char* utoa (unsigned int val, char *s, int radix);

#ifdef _NEED_ULTOA
char* ultoa (unsigned long val, char *s, int radix);
#endif
 
#ifdef _NEED_DTOSTRF
char* dtostrf (double val, signed char width, unsigned char prec, char *s);
#endif

#ifdef _NEED_REVERSE
void reverse(char* begin, char* end);
#endif

#ifdef __cplusplus
} // extern "C"
#endif


#endif

I don't want to be a bad question-asker, but I don't know what other information I should add. I've gone looking for macros that might be causing issues, and I've looked at the files that #include stdlib_noniso.h, but I haven't been able to find anything there either. For the record, those files that include it are WProgram.h, WString.h, and noniso.c, all of which are also part of chipkit core.

9
  • 1
    I guess the 25 first lines of the noniso.c would be essential ... but soon you'd have copied the entire library to SO... Commented Jan 21, 2021 at 5:33
  • There's probably a missing semicolon, brace/bracket/parenthesis somewhere. Commented Jan 21, 2021 at 5:35
  • maybe you didn't #include <Arduino.h> Commented Jan 21, 2021 at 7:39
  • 1. I have copied the entire library, so I don't have to deal with tracking down the chain of dependencies. I can do that if I need to, but this particular file is used. Commented Jan 21, 2021 at 15:13
  • 2. I didn't say it, but that's one of the things I checked in the files I mentioned. I guess I can also check the #included files that are included immediately before stdlib_noniso.h. Commented Jan 21, 2021 at 15:16

1 Answer 1

-1

Did you use the chipKIT project importer? I have not ever tired to debug a sketch with MPLAB but I know others that have. This is not real helpful but I think there is a tutorial out there that I'll keep looking for: https://chipkit.net/debug-chipkit-sketches-in-mplab-x-ide/

Edit: Found the importer instructions: https://chipkit.net/wiki/index.php?title=MPLABX_Importer

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah, I tried to use the chipKIT importer, but it gives me the following error: ` java.lang.IllegalArgumentException: Did not find any variant directory for board "chipkit_uc32" at com.microchip.mplab.nbide.embedded.chipkit.importer.ChipKitBoardConfigNavigator.getChipKitVariantPath(ChipKitBoardConfigNavigator.java:204) at com.microchip.mplab.nbide.embedded.chipkit.importer.ChipKitProjectImporter.execute(ChipKitProjectImporter.java:163) at com.microchip.mplab.nbide.embedded.chipkit.wizard.ImportWorker.importChipKitProjectFiles(ImportWorker.java:275) at com.microchip.mpl......`
Also tried the Arduino Project importer, but in that case it won't let me try & gives me the warning message "Arduino IDE needs to be in version 1.8.0 or newer", despite my Arduino IDE being 1.8.13.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.