CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

[solved] modbus_phy_layer_rtu.c Error#44 ...

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
zzeroo



Joined: 17 Jun 2013
Posts: 18

View user's profile Send private message

[solved] modbus_phy_layer_rtu.c Error#44 ...
PostPosted: Wed Oct 30, 2013 7:35 am     Reply with quote

Hi,

I try to compile the Modbus Slave example ex_modbus_slave.c from the Examples dir. But everytime I run into the error "modbus_phy_layer_rtu.c:25:9: Error#44 Internal Error - Contact CCS PPUSE "

Here is my code so far:
Code:
#include <18f4520.h>
#fuses HS,NOWDT
#use delay(clock=11000000)
//#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

#define MODBUS_TYPE MODBUS_TYPE_SLAVE
#define MODBUS_SERIAL_TYPE MODBUS_RTU     //use MODBUS_ASCII for ASCII mode
#define MODBUS_SERIAL_RX_BUFFER_SIZE 64
#define MODBUS_SERIAL_BAUD 9600

#define MODBUS_SERIAL_INT_SOURCE MODBUS_INT_RDA

#include <modbus.c>

#define MODBUS_ADDRESS 0xF7

void main(void) {
}


This is the error output:
Code:
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `C:/Entwicklung/Modbus-Gaszentrale/Modbus-Gaszentrale.X'
make -j 8 -f nbproject/Makefile-default.mk dist/default/production/Modbus-Gaszentrale.X.production.hex
make[2]: Entering directory `C:/Entwicklung/Modbus-Gaszentrale/Modbus-Gaszentrale.X'
gnumkdir -p build/default/production
gnumkdir -p dist/default/production
"C:\opt\PICC\CCSCON.exe"  out="build/default/production"  Modbus-Gaszentrale.c +FH +DF +CC +Y=9 +EA +DF +LN +T +A +M +J +EA +Z -P #__18F4520=1
C:\opt\PICC\drivers\modbus_phy_layer_rtu.c:25:9:  Error#44  Internal Error - Contact CCS  PPUSE
      1 Errors,  0 Warnings.
Build Failed.


I'm using the 5.012 CCS Compiler. I also have tried the 4.140 Version, with the same results.


Last edited by zzeroo on Fri Nov 01, 2013 1:03 am; edited 4 times in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Wed Oct 30, 2013 9:12 am     Reply with quote

I just compiled the file with 4.140, 141, 5.010, and 5.013 and it compiled fine in each.

Looks as if you are compiling in something like MPLAB?. It looks as if the fault is with the way you are trying to compile, rather than with the CCS files. Try being 'simple', and just calling CCSC with your sourcefile to compile, without all the options. If it then works, it is a case of working out which of these is causing the problem.

Several of your options are repeated, and some like +T, make compilation take an age - unless you need this don't use it. +CC is normally only used when you are linking.

Just the file 'as is', compiles fine, unless your copy of the physical layer has been modified.

Best Wishes
zzeroo



Joined: 17 Jun 2013
Posts: 18

View user's profile Send private message

PostPosted: Wed Oct 30, 2013 10:26 am     Reply with quote

No, I created a new empty project and compile without any luck

Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Wed Oct 30, 2013 12:05 pm     Reply with quote

Try reloading the original files (if you have the downloaded installer?).
Make sure the project is picking up the correct include file. They have a habit of 'finding' other versions sometimes.

Best Wishes
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Wed Oct 30, 2013 12:17 pm     Reply with quote

I notice another poster was having the same problem. However for him it worked if he went back to a V4 version. As for me, PCM programmer found it compiled for him:

<http://www.ccsinfo.com/forum/viewtopic.php?t=50987>

It must be something machine specific. RAM amount, layout of the directories (try letting CCS install into it's default locations), etc. etc..

Another poster on an older version also had this, and a full re-install fixed it:

<www.ccsinfo.com/forum/viewtopic.php?t=50283>

Try renaming your project, using underscore instead of hyphen in the filename. Hyphen can cause parsing problems, depending on what language CCS is actually written in. It is not a legitimate filename character in quite a few languages.

Best Wishes
zzeroo



Joined: 17 Jun 2013
Posts: 18

View user's profile Send private message

PostPosted: Thu Oct 31, 2013 12:26 am     Reply with quote

Uff Shocked andWTF! Question

Problem solved, thank you Ttelmah. But it must further investigate how and why this was happen.

I deleted the whole PICC directory. After that I run the setup again and let him install to the default location. Then I replaced the hyphen in the filename to underscores. Lastly I have deinstalled and reinstalled the MPLABX toolchain plugin -> and it runs! It compiles without any error now. (kind of black magic found?)
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Thu Oct 31, 2013 1:44 am     Reply with quote

If you find exactly what item triggers it, post back, since then future people with the problem can be helped.

I'd guess it is probably one thing in the install.
I'm sneakily suspicious of the hyphen in the install directory name. The posters in the other two threads didn't give the directory names they were using when the problem happened. The MODBUS example does a lot of scripting constructs in the compile, and these are using something closer to perhaps a scripting language, than the actual 'compilation' itself. Now several scripting languages (Python for example), won't allow hyphen's in the file names. If you notice, hyphen is used as the 'marker' for the commands in the compile line itself, so I'd be not at all surprised if the compiler has problems triggered when this is in the filename, though not until certain other things are done....
Hyphens are also 'often not recommended' in Unix environments, where some of the shells treat it as a 'shorthand' for stdin/stdout, and a leading hyphen implies a command character following.

My 'best guess'....

Best Wishes
zzeroo



Joined: 17 Jun 2013
Posts: 18

View user's profile Send private message

PostPosted: Thu Oct 31, 2013 5:54 am     Reply with quote

Oh man I'm so sorry. I had this morning not included the modbus.c file Embarassed and because that no error.

I've tried many different workstation this day, completely new installed CCS5.012 and CCS4.104 on a project without hyphens, no luck.

Code:
*** Error 44 "C:\Program Files (x86)\PICC\Drivers\modbus_phy_layer_rtu.c" Line 25(9,47): Internal Error - Contact CCS  PPUSE


This is the line with the error:
Code:
TIMER(TIMER=1,TICK=.1ms,BITS=16, ISR)


I hope to violate not the forum rules by posting a part of modbus_phy_layer.c where the error happens.
Code:

#if (MODBUS_TIMER_USED == MODBUS_TIMER_T1)
  #if (MODBUS_TIMER_UPDATE == MODBUS_TIMER_ISR)
    #USE TIMER(TIMER=1,TICK=.1ms,BITS=16, ISR)
  #else
    #USE TIMER(TIMER=1,TICK=.1ms,BITS=16, NOISR)
  #endif
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Oct 31, 2013 7:22 am     Reply with quote

comment..
I don't use modbus, never looked at the drivers, can't test but....

is .1ms a valid option for TICK ?
or...
do you have a ISR for the TIMER ?

just thought I'd throw 'something' for you to consider.

hth
jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Thu Oct 31, 2013 9:08 am     Reply with quote

The silly thing is it compiles.

You don't need anything but the file posted to test (drivers come with the compiler). I have:
Code:

#include <18f4520.h>
#fuses HS,NOWDT
#use delay(clock=11000000)

#define MODBUS_TYPE MODBUS_TYPE_SLAVE
#define MODBUS_SERIAL_TYPE MODBUS_RTU     //use MODBUS_ASCII for ASCII mode
#define MODBUS_SERIAL_RX_BUFFER_SIZE 64
#define MODBUS_SERIAL_BAUD 9600

#define MODBUS_SERIAL_INT_SOURCE MODBUS_INT_RDA

#include <modbus.c>

#define MODBUS_ADDRESS 0xF7

void main(void)
{

}

as "modbus_rtu_slave_test.c"
and it happily compiles with every compiler I have tried....

Remember when you switch compilers you need to 'tell' the project to switch which files it includes. I get errors if the V4 includes are used with V5, and vice versa. The compilers default to detecting the includes to use, and get this wrong if you are switching compilers.

Most of the code generates nothing, since the actual calls are not made, but it is being successfully parsed by the compiler.

I get an 'info' from almost exactly this point, saying:

"Timer 1 tick time is 93.08 us", but no actual problems.....

I'd contact CCS, since it sounds as if it is something specific to your system. Might be something really silly like the 'national' settings interfering with something they are doing. Have seen this on a surprising number of occasions. Perhaps try changing this to 'us-english' temporarily and see if things alter.

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 31, 2013 9:14 am     Reply with quote

Yes, I also got it to compile with the changes as posted. But I don't see
any PIC listed in the drop-down box at the top of the IDE. I don't use
the CCS IDE, but maybe that's significant.

Try the following test:

You're modifying the source files. What happens if you:

1. Re-install vs. 5.012 of the CCS compiler.
2. Make a new project in the Examples directory and call it
Ex_modbus_slave.
3. Select Ex_modbus_slave.c as the main file in the project.
4. Don't enable Multiple Compilation Units in the CCS IDE.
5. Select 18F6722 as the PIC
6. Don't edit any files.

and then compile the project. Does it now compile OK ?

I tried that under MPLAB vs. 8.91 and it compiles with no errors.
It has a couple warnings about interrupts disabled to prevent re-entrancy
but that's not a error. It compiles OK.
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Thu Oct 31, 2013 9:24 am     Reply with quote

I'm just having a little 'sneaking possibility' about national settings.

I think the code it calculating the timer tick value where it fails. Reading the clock value (possibly as a string), and then calculating the settings for the timer.
I was wondering if anyone with ',' as their decimal separator had tried this particular example?.....

Yes - this is the problem!.....

Have just switched my system location to France, rebooted, tried the compile, and I'm getting the exact error.

I think it is parsing something into a string, and then probably looking for the decimal in the calculation, and failing with the ','......

If you can accept the different number formats, switch to US English to get it working, and report the problem to CCS.

Aaargh......

Best Wishes
jeremiah



Joined: 20 Jul 2010
Posts: 1345

View user's profile Send private message

PostPosted: Thu Oct 31, 2013 9:54 pm     Reply with quote

PCM programmer wrote:
Yes, I also got it to compile with the changes as posted. But I don't see
any PIC listed in the drop-down box at the top of the IDE. I don't use
the CCS IDE, but maybe that's significant.


The most recent compiler will pick the right compiler based on his #include. What usually happens is the first time you compile, it gives an error telling you to try a different compiler (PCD, PCH, etc depending on the #include), but auto fills those fields for the next compile. At least it does this in PCWHD.
zzeroo



Joined: 17 Jun 2013
Posts: 18

View user's profile Send private message

PostPosted: Fri Nov 01, 2013 1:03 am     Reply with quote

Oh man, I would have also come to it themselves.

Thank you Ttelmah, the tip with the separator was it. For all who fall also into that trap here a small "click-path" to change the decimal separator on a German Windows 7 system.



1. Start
2. input "Sprache" (language)
3. click "Weitere Einstellungen" (advanced settings)
4. insert a DOT (.) instead of the (,)

With a (.) the code complies fine, thank you all!
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Fri Nov 01, 2013 4:17 am     Reply with quote

Glad it is working....

A 'caveat'. I'd change the thousands separator to a comma. Having the decimal separator the same character as the thousands separator is bound to cause problems somewhere!.....

It is interesting, because internally, 'C' always uses '.' My guess is that they are using one of the API functions to do part of the calculation, with the 'national' settings enabled, then switch to handling the result themselves, without any national changes. Result, complete confusion.....

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group