Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: sam-ba 2.11 and at91sam9g20 (using sam-ba.dll)
PostPosted: Tue Nov 08, 2011 5:59 pm 
Offline

Joined: Tue Jun 26, 2007 6:27 pm
Posts: 82
Hello,

I have large problem....

I´m using the latest sam-ba version 2.11 and I wrote an mfc application to use the sam-ba.dll.
I have an at91sam9g20 Rev.B

1.) After I execute the function AT91Boot_Scan(...) I have memory leaks although I free the complete memory - Could anybody verify it... Thanks a lot.

2.)I plug in my AT91SAM9G20 board -> "Romboot" appears on the console -> SAM-BA Bootloader is running. Then I start my code below, the scan functions returns "\USBserial\COM5" but the function AT91Boot_Open(...) never returns !!!!

Could anybody verify my problem - Thanks a lot.

This is my code:

AT91BOOT_HANDLE_TYPE h_handle = 0;
int i=0;

for(i=0; i<50; i++)
{
pDeviceList[i] = (char*)malloc(512);
}

// Scan all devices connected
m_pAT91BootDLL->AT91Boot_Scan((char *)pDeviceList);
for (i=0; i<50; i++)
{
if(pDeviceList[i] != NULL)
{
Device = pDeviceList[i];
iBack = Device.Find("\\USBserial\\", 0);
if(iBack == 0)
{
m_pAT91BootDLL->AT91Boot_Open(pDeviceList[i], &h_handle);
if (h_handle != 0)
{
m_pAT91BootDLL->AT91Boot_Close(h_handle);
}
}
}
}

for(i=0; i<50; i++)
{
free(pDeviceList[i]);
}


Top
 Profile  
 
 Post subject: Re: sam-ba 2.11 and at91sam9g20 (using sam-ba.dll)
PostPosted: Tue Nov 08, 2011 6:10 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
For the memory leak, you should probably clear h_handle after you close it, removing the potential for it to be released twice.

As for hanging, sounds like just another day with SAM-BA

At least 2.11 actually appears to function sometimes under Win7 64 Pro


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to: