SAM3X8 Safe and secure bootloader Tomcrypt problems

Discussion around product based on ARM Cortex M3 core.

Moderators: nferre, ncollot

tomshirvo
Posts: 11
Joined: Wed Oct 22, 2014 7:22 am

SAM3X8 Safe and secure bootloader Tomcrypt problems

Wed Oct 22, 2014 7:30 am

I have been converting the "Atmel-42141-SAM-AT02333-Safe-and-Secure-Bootloader-Implementation-for-SAM3-4_Application" to Atmel Studio 6.2.

I have got the bootloader working without the encryption in but I am now trying to add it back.

I keep getting errors about the 'ulong32' data type that are used in the TomCrypt library.

Is anyone able to tell me why and what I should do to stop these errors. 
Attachments
error.png
error.png (227.73 KiB) Viewed 3187 times
jharley
Posts: 238
Joined: Thu Dec 06, 2012 6:40 am

Re: SAM3X8 Safe and secure bootloader Tomcrypt problems

Thu Oct 23, 2014 12:43 am

The compiler is telling you that it cannot find the definition of this type when it compiles this file.

Most likely you are missing a header file...

tomcrypt_macros.h
tomshirvo
Posts: 11
Joined: Wed Oct 22, 2014 7:22 am

Re: SAM3X8 Safe and secure bootloader Tomcrypt problems

Tue Oct 28, 2014 2:15 am

Having more problems, I have solved a few but I am now stuck on these errors.

I have added all of the header files into the include paths but that doesn't seem to help on this error

Image showing errors

https://www.dropbox.com/s/duf4mcufn4doj ... 2.png?dl=0
tallman
Posts: 42
Joined: Wed Mar 20, 2013 4:09 pm

Re: SAM3X8 Safe and secure bootloader Tomcrypt problems

Wed Nov 12, 2014 7:17 pm

Hello tomshirvo,

Did you get this to work - libTomcrypt in atmelstudio ?  I'm doing this now shortly after you, and found your message when I hit the same error.  Any advice would be appreciated.

Brent
tomshirvo
Posts: 11
Joined: Wed Oct 22, 2014 7:22 am

Re: SAM3X8 Safe and secure bootloader Tomcrypt problems

Wed Nov 19, 2014 6:05 am

No I got stuck and have moved on to another project at the moment. Have you had any luck since your post?
tallman
Posts: 42
Joined: Wed Mar 20, 2013 4:09 pm

Re: SAM3X8 Safe and secure bootloader Tomcrypt problems

Wed Nov 19, 2014 11:02 pm

Actually did get it all done.  I was happy.  Had to spend little time working through the bugs it produced.  Mostly Defines not set as I remember or headers getting included multiple times(it was week ago and I forgot most already). 

Oh one thing I did have to do is take the current tomcrypt from the website and when I had trouble with a program/header from the Atmel example code, compare the two as the one on the tomcrypt site had been fixed in some cases.

I was really happy with how easy this solution ended up being to implement (after the bugs) 

Brent
tomshirvo
Posts: 11
Joined: Wed Oct 22, 2014 7:22 am

Re: SAM3X8 Safe and secure bootloader Tomcrypt problems

Wed Nov 19, 2014 11:47 pm

Brent,

Good job, I was pulling my hair out for a while.

Are you willing to share the code and project file. There are a few people out there I have found that have wanted this including myself. 

Thanks
tomshirvo
Posts: 11
Joined: Wed Oct 22, 2014 7:22 am

Re: SAM3X8 Safe and secure bootloader Tomcrypt problems

Mon Dec 08, 2014 3:03 am

Hi Brent,

Working on this bootloader again I am not having any luck at all. 

I have disabled the Tomcrypt part of the bootloader just to try and get the thing to work. I have been able to get the bootloader on the chip and get the firmware uploaded onto the device through the bootloader but I can't get the program to run. I just compiled the simple "Blink" program and uploaded the .bin file. 

Image

I thought it might be because I had to put the bootloader in both of the flash areas. I did that with the SAM-BA  but that still didn't work.

Also wondering if it has something to do with the code start at the top of the bootloader main.c file. It doesn't look like the HEX values are correct so I will play around with that.

Image

Any help would be great.
tallman
Posts: 42
Joined: Wed Mar 20, 2013 4:09 pm

Re: SAM3X8 Safe and secure bootloader Tomcrypt problems

Mon Dec 08, 2014 2:48 pm

Just to confirm your saying your uploading bootloader, then had it upload your code, and run, and it's not starting.

Make sure you compiled your bin in correct memory location with .text=0x0080 if thats where your firmware will reside in flash and run.  Also you don't start it at that address.  You start at an offset.
I used atmels doc
Atmel-42141-SAM-AT02333-Safe-and-Secure-Bootloader-Implementation-for-SAM3-4_Application-Note
 and the example project for bootloader as example.  I know the two things I mentioned gave me trouble, until I figured out how they work.

Also you might start a new thread rather than associating this with Tomcryptlib.
Brent

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 3 guests