Firmware works in one AT90CAN device but not the other

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've inherited some projects at work and know little about coding. Everything I've learned is from hands on because I had to. That said, I have a motor control circuit that was designed around the AT90CAN128 device. It works well and I have no issues there. one of our CM's accidentally installed the AT90CAN64 device on several boards and these do not function. The firmware hex file fits on the 64k flash and programs successfully, provided the device is selected in AS studio, but the boards do not function at all. During development, the boards were designed with the 64k device in mind but all production boards were built with the 128k device. Not sure why the change; the person who would have all the answers passed suddenly. This is what I do know....the list of what I do not know is much larger. 

 

When a project is created is it device dependent? Could it be that the 2k EEPROM on the 64k device is too small for my program, I'm not sure how to tell? 

 

 

This topic has a solution.
Last Edited: Wed. Sep 12, 2018 - 05:48 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I load my project in Atmel Studio and look at the project options, It is clear that the AT90CAN128 device is selected. Should I now assume that when I rebuild the solution and create my hex file that the AT90CAN128 device is the only device that will work with this project? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I answered my own question. It is clear to me now that the target device is selected when the project is created in the first place. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the project options in Atmel Studio, I have a button to change the device type. My current project device is the AT90CAN128 but I can select the CAN64 device. I get a message that ASF does not supprt changing the device type due to possible library changes but it looks like it did make the change anyway. The device type is now shown as AT90CAN64. If I rebuild this solution and create a new hex file, shou8ld my firmware now operate correctly on the 64k device? The program does do some writing to EEPROM but I am not sure how much EEPROM is actually required....is there a way to tell? If I can get my firmware to operate properly with the AT90CAN64 devices, I could prevent us from having to rework hundreds of boards. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not sure about that problem with libraries, etc.  You could make a new duplicate project, for the '64 part, and simply copy all your source files and settings (except the device type) into that project.  Seems like that would ensure a valid build.

 

And you'll need to look at the compiler output to make sure that you have enough memory (flash, SRAM, EEPROM) in the smaller part.  Remember also that the SRAM figure does not include the memory needed for stack.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Currently, when I perform a rebuild, SRAM and EEPROM show 0 bytes and my flash is around 32k. I know that when the program is running on the processor, it writes information to EEPROM but I have no idea how to determine approximately how much. We keep an event log but it should only get so big because it overwrites itself over a period of time. I can only assume that he spec'ed the 128K device for a reason. I will try to create a new project; in the least, I should learn something from it, right? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is what happens when you have one EE who does all the design and coding himself then passes away suddenly. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

0 bytes of SRAM in a 32k program?!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kk6gm wrote:
0 bytes of SRAM in a 32k program?!
Possible.  Barely.

It would suggest that someone worked hard to avoid globals and statics.

Also, no math error value from the math library.

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?