• 0
victory460

Arduino IDE Compiled SoftwareSerialExample failed

Question

 I tried to use

‘ Arduino15 \ packages \ Digilent \ hardware \ pic32 \ 1.0.3 \ libraries \ SoftwareSerial\examples\SoftwareSerialExample‘
Soft serial port to achieve a send and receive function, but it is wrong:

 

Arduino:1.6.9 (Windows 10),     "Digilent WiFIRE(Rev D)"


C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int, uint32_t)':

C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\libraries\SoftwareSerial\SoftwareSerial.cpp:700:20: error: 'volatile union __CNCONAbits_t' has no member named 'SIDL'

         CNCONAbits.SIDL = 0;

                    ^

C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\libraries\SoftwareSerial\SoftwareSerial.cpp:703:20: error: 'volatile union __CNCONBbits_t' has no member named 'SIDL'

         CNCONBbits.SIDL = 0;

                    ^

C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\libraries\SoftwareSerial\SoftwareSerial.cpp:706:20: error: 'volatile union __CNCONCbits_t' has no member named 'SIDL'

         CNCONCbits.SIDL = 0;

                    ^

C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\libraries\SoftwareSerial\SoftwareSerial.cpp:709:20: error: 'volatile union __CNCONDbits_t' has no member named 'SIDL'

         CNCONDbits.SIDL = 0;

                    ^

C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\libraries\SoftwareSerial\SoftwareSerial.cpp:712:20: error: 'volatile union __CNCONEbits_t' has no member named 'SIDL'

         CNCONEbits.SIDL = 0;

                    ^

C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\libraries\SoftwareSerial\SoftwareSerial.cpp:715:20: error: 'volatile union __CNCONFbits_t' has no member named 'SIDL'

         CNCONFbits.SIDL = 0;

                    ^

C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\libraries\SoftwareSerial\SoftwareSerial.cpp:718:20: error: 'volatile union __CNCONGbits_t' has no member named 'SIDL'

         CNCONGbits.SIDL = 0;

                    ^

exit status 255

 

which is why?How to solve it?

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @victory460,

I think (but don't know for certain) that the issue is that the source code for the SoftwareSerial library (not originally designed by Digilent) doesn't support the MZ chip that is used on the WiFIRE boards since I was able to successfully compile the software serial example for all of the other PIC32MX based Digilent boards.

I have asked another Digilent engineer to confirm this and to learn what sort of changes would need to be made to get this example in the Digilent core working for the WiFIRE board.

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 0

Hi @victory460,

James was correct, it is an issue in the source code for the SoftwareSerial library. The PIC32MZEFG100 does not have an SIDL bit in the CNCON register like the older chips. You can get around this by commenting out those lines in SoftwareSerial.cpp for now. I have added an ifndef line to fix this in the Digilent Core v1.0.4 which i just uploaded.

Hope this helps!

Tommy

victory460 likes this

Share this post


Link to post
Share on other sites
  • 0
On 2018/1/10 at 5:10 AM, tom21091 said:

Hi @victory460,

James was correct, it is an issue in the source code for the SoftwareSerial library. The PIC32MZEFG100 does not have an SIDL bit in the CNCON register like the older chips. You can get around this by commenting out those lines in SoftwareSerial.cpp for now. I have added an ifndef line to fix this in the Digilent Core v1.0.4 which i just uploaded.

Hope this helps!

Tommy

Thank you very much for your answer, I followed your approach, and it succeeded.

My goal is to add another one serial communication to OpenScope MZ then I tried to use a soft serial port in the OpenScope MZ firmware, but it compiled failed.

 

image.png.006fa0388169ef084d2f784425a09603.png

Arduino:1.6.9 (Windows 10),  "Digilent OpenScope"

In file included from C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\cores\pic32/WProgram.h:20:0,

                 from C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\cores\pic32/Arduino.h:4,

                 from C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\libraries\SoftwareSerial/SoftwareSerial.h:40,

                 from sketch\main.cpp:17:

C:\Users\victory\AppData\Local\Arduino15\packages\Digilent\hardware\pic32\1.0.3\cores\pic32/HardwareSerial.h:264:39: error: conflicting declaration 'HardwareSerial Serial'

                 extern HardwareSerial Serial;

                                       ^

In file included from sketch\main.cpp:15:0:

OpenScope.h:1486: error: 'Serial' has a previous declaration as 'OSSerial Serial'

     extern OSSerial         Serial;

                             ^

exit status 255
'Serial' has a previous declaration as 'OSSerial Serial'

 

I know this question is repeated definition Serial, but I do not know how to modify it to add a serial port.

Please help me to add one serial communication to OpenScope MZ .Thank you very much.

OpenScope MZ Firmware:https://github.com/victory460/OpenScope

@tom21091

 

Edited by victory460

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now