RobotC failure to download

So, RobotC decided to not download today, for no apparent reason.

Information:
-It worked about an hour ago with this exact setup
-Cortex and Joystick tethered, new battery in robot
-I tried a new joystick
-Joystick LED’s - RED joystick (powered off tether), GREEN robot and VEXnet
-Joystick connected to computer via orange programming cable
-I am on master 3.17 on both Joystick and Cortex
-I am able to download RobotC firmware fine, no issues other than “unable to start user code”.
-I am able to download RobotC code right after downloading firmware, and it complains about the Cortex not being in Vexnet competition mode and how I have to reboot. After rebooting, I am unable to talk to the user processor at all (download or debugger)
-RobotC says it can talk to the master, but it says its unable to talk to VEX PIC user processor (I am sure I am in Cortex 2.0 mode)
-The debugger says “Failure to read brick status more” - I am sure I am in Cortex mode, and don’t even have the NXT version, but it says brick status?

Any ideas?

More information:

-I backed the Master version on the Cortex and Joystick back to 3.16 (the version that RobotC ships with)
-I looked at the Software Inspection to see what it said, and it found:

-Immediately after downloading RobotC firmware (no user code yet), I get:

Communications Link:               COM Port 'COM14' to Game Controller
                                   

Firmware File Names:
====================
VEXNET Game Controller:            .\Firmware\WIFI_OI_2p0_V3_16.BIN
VEX Cortex Master CPU Firmware:    .\Firmware\WIFI_RC_2p0_V3_16.BIN
VEX Cortex CPU Firmware:           .\Firmware\VEX_Cortex_0904.hex

VEXnet Joystick Integrity:
==========================
Firmware Version:                  3.16                    Up to Date
Battery Voltage:                   4.7V                    Poor (<6.1V)
Calibrated:                                                No

Cortex Master CPU Integrity:
============================
Firmware Version:                  3.16                    Up to Date
Main Battery:                      7.6V                    Good (>6.5V)
Backup Battery:                    9.5V                    Good (>8.7V)

Cortex User CPU Integrity:
==========================
Firmware Version:                  9.04                    Up to Date
Program Type:                      Standalone Wi-Fi        Not valid for competition use

-After I download user code but don’t reboot, I get (aside from a “reboot required” dialog box):

Communications Link:               COM Port 'COM14' to Game Controller
                                   

Firmware File Names:
====================
VEXNET Game Controller:            .\Firmware\WIFI_OI_2p0_V3_16.BIN
VEX Cortex Master CPU Firmware:    .\Firmware\WIFI_RC_2p0_V3_16.BIN
VEX Cortex CPU Firmware:           .\Firmware\VEX_Cortex_0904.hex

VEXnet Joystick Integrity:
==========================
Firmware Version:                  3.16                    Up to Date
Battery Voltage:                   4.7V                    Poor (<6.1V)
Calibrated:                                                No

Cortex Master CPU Integrity:
============================
Firmware Version:                  3.16                    Up to Date
Main Battery:                      7.6V                    Good (>6.5V)
Backup Battery:                    9.5V                    Good (>8.7V)

Cortex User CPU Integrity:
==========================
Firmware Version:                  9.04                    Up to Date
Program Type:                      Standalone Wi-Fi        Not valid for competition use

as expected.

-I then reboot the Cortex (disconnecting the backup battery so it turns off), and get this:

Communications Link:               COM Port 'COM14' to Game Controller
                                   

Firmware File Names:
====================
VEXNET Game Controller:            .\Firmware\WIFI_OI_2p0_V3_16.BIN
VEX Cortex Master CPU Firmware:    .\Firmware\WIFI_RC_2p0_V3_16.BIN
VEX Cortex CPU Firmware:           .\Firmware\VEX_Cortex_0904.hex

VEXnet Joystick Integrity:
==========================
Firmware Version:                  3.16                    Up to Date
Battery Voltage:                   4.7V                    Poor (<6.1V)
Calibrated:                                                No

Cortex Master CPU Integrity:
============================
Firmware Version:                  3.16                    Up to Date

Cortex User CPU Integrity:
==========================
Cortex USER CPU not responding. Firmware may need to be reloaded.

I also can’t talk to the robot code at all (no download, no debugger, no file system viewer) which shows that the firmware is in fact not running.

Any ideas? I’ll ask robotC support on Monday (I assume they aren’t in on the weekends), but was hoping to get a reply from the community sooner.

Have you tried running the code without rebooting? (it’s not absolutely necessary).

Have you tried alternative (simple) code ?

Although EasyC is shipping with 3.17 master firmware I have avoided upgrading until CMU releases 3.05.

Since your robot seems to have all the right software loaded the next thing I would examine is the pc you are using. specifically the drivers for the cortex and programming kit. I had an experience not too long ago where my Win 7 laptop would go to a blue screen of death and re-boot while running the Robot C debugger. in the end I solved that problem by reloading all the software( may have been extreme. I found as I was working with re-installing the drivers there was an old version of one of the drivers still installed. I used windows uninstall to remove all previous versions and have since had no problems. If you are running Easy C 4.0.2.8 perhaps there is some incompatibility at the driver level with RobotC 3.04 ?

-I tried going back to 3.16, no change.

-If I run code without rebooting, it will start, but I can’t do anything (presumably because I’m not in the right mode, but I don’t know).

-I later tried the IFI default code (through Intelitek loader) and it worked
-I eventually tried robotC competition template (unmodified), and it worked also.
-I was on 3.03 (clicking “check for updates” said I had the latest version), so I downloaded 3.04 and installed it, and that doesn’t fix the issue.

This points to an issue in my code causing the robotC VM to crash. However, I get no compiler errors or warnings indicating anything bad, and the compiler statistics show I am not close to the memory limit. What is also odd is that I was debugging a block of math code when it started failing (I found a scenario where I can get rollover), and commenting it all out doesn’t fix the issue.

If anyone wants to look through it, I can email it to you, but I’d rather not post it on a public forum yet.

The laptop I am using runs Windows XP SP3, and is dedicated to Vex programming. I have robotC 3.04, easyC 4.0.2.8, the Prolific serial driver, and Vex RC driver all installed. RobotC, Intelitek Loader, and IFI Firmware Update can all talk to the Master and User processors in both ways, so it’s not a driver issue.

I sent you a PM with contact info. - Kb

Issue resolved. A syntax error in a print statement (%b instead of %d).

Andrew, good catch, looks like an invalid format string to sprintf will crash the RobotC VM. It crashes the PC emulator also. For example, this will cause the cortex to crash.

task main()
{
    string str;
    
    while(1)
        {
        sprintf(str,"%b", (long)23 );
        writeDebugStreamLine(str);

        wait1Msec(1000);
        }
}

The solution for now is “don’t do it” :slight_smile: Hopefully CMU can fix for the next release.