This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

use SD card + USB via micro and PC

Hi,

I've used this example of Keil:
C:\Keil\ARM\Boards\Keil\MCB1700\RL\USB\Device\Memory_FlashFS
I want (whenever I needed) be able to switch between two cases:
1)access to SD card via Micro (SPI)
2)access to SD card via PC (PC detects micro as mass storage device)

I've used a key for switch between cases +unfortunatly I had to plugin (the USB cable) again for reconfig it after a switch :( . my code is:

if(switchmode==0)
{
....
funinit(NULL);
mc0 = ioc_getcb (NULL);
if(ioc_init (mc0) == 0)
{
ioc_read_info (&info, mc0);
usbd_init();
usbd_connect(__TRUE);
while (!usbd_configured());
}
}
else
{
usbd_connect(__FALSE);
ioc_uninit (mc0);
finit(NULL);
}

I know that I can't disconnect USB device by RL library.(if I can tell me how,please)
Please guide me : how can I swith through firmware(not hardware)? (my microcontroller is NXP LPC1768)