Software > Software

McUber failing to upload code. Im missing something.

(1/2) > >>

Hello all!

I am writing a dead reckoning program using the latest Webbotlib Project Designer on the Axon II microcontroller. The program compiles fine using AVR studio 4.19. When I go to upload the hex file to the Axon, the bar goes to max then I get an error message saying that the file failed to flash. I removed bits of code and uploaded it again and again until I found the culprit.

It is during the "reverse" cycle of driving. The forward version of the same code works fine.

--- Code: --- if (leftticks < rampdownticks){
int difference = -180 - (leftticks - rampdownticks);
leftspeed = interpolate(difference, 0, -180, -40, DRIVE_SPEED_MIN);
--- End code ---

leftticks is the number of encoder ticks. Rampdownticks is one full rotation (180 ticks) away from the final distance.

The goal is for the motor to ramp down at during the last full wheel rotation to help eliminate some of the slop I was getting.

The "forward" version of the same code that works like a charm:

--- Code: --- if (leftticks > rampdownticks){
int difference = 180 - (leftticks - rampdownticks);
leftspeed = interpolate(difference, 0, 180, 40, DRIVE_SPEED_MAX);
--- End code ---

Im sure there is something going on that Im not aware of, or my logic failed somewhere along the way, but I would like another set of eyes on this.

Thank you!

Any code errors would come up at compile time or run time and definitely not at flash time. The only reason I can think of is that Your HEX file is too big, hence does not fit flash memory in microcontroller. Do You use code optimisation?

I really cant imagine that the file is too big. I think something may be a little wonky with McUber on my PC. I may have to try to use my old programmer for it.

Can You post size of Your HEX file?

39.4k. If everything that can be compiled can be uploaded no problem, there is definitely something fishy going on. I've had the same issue with a simple "cout << variable" line that it wouldn't upload unless I deleted that line.


[0] Message Index

[#] Next page

Go to full version