DFU always fail with xu232

New to XMOS and XCore? Get started here.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Hi. Please review and test the solution posted here:

https://www.xcore.com/viewtopic.php?f=37&t=6053

Please post your updates and results.


TonyXiao
Active Member
Posts: 44
Joined: Fri Mar 29, 2019 3:58 am

Post by TonyXiao »

hi, all

with our fae suppurt, now add a 24M clock to PORT_MCLK_IN, now single XUF232 DFU function works.
for our requirements, we don't need play any audio, only need usb midi device, and another problem comes can i delete all the audio ports and dfu still working? so far for usb midi device, i didn't use any of the audio ports, and it indeed works. but i am not sure for the DFU.

and dfu function failed when i xlinked XU208, the program stuck in reboot.xc below sentence:
write_sswitch_reg_no_ack(tileId, 6, pllVal);

After the two XMOS chips are xlinked, should there be some special processing during operate the two XMOS resets?
Instead of simply resetting each tile in turn as one XMOS?
any advice are appreciated.

BR,
Tony
User avatar
fabriceo
Experienced Member
Posts: 94
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

Hi,
I m also experiencing lot of pain with dfu upgrade (xu216). I got it to work some time ago, but now it doesn't work anymore again.
I have identified that this is because tile1 don't want to reboot.
the device_reboot() in reboot.xc seems to work fine for rebooting tile 0 but tile1 doesn't...
any experience welcome
User avatar
fabriceo
Experienced Member
Posts: 94
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

Hi
I tried the run --dump-state as explained here:
https://www.xcore.com/viewtopic.php?t=4060
I saw a couple of problem with my application as the dfuhandler was distributed on another task than audio() and also the boot was stuck in ffff04c8 which meant that the xtag/jtag was the problem. finally, doing things step by step and removing the xtag after a cold boot solved it.
my reboot code is simply this one now and looks fine:

Code: Select all

    read_sswitch_reg(get_local_tile_id(), 6, pllVal);
    pllVal &=0xFFFF;
    write_sswitch_reg_no_ack(get_local_tile_id()^1, 6, pllVal);
    write_sswitch_reg_no_ack(get_local_tile_id(),   6, pllVal);
hope this helps
TonyXiao
Active Member
Posts: 44
Joined: Fri Mar 29, 2019 3:58 am

Post by TonyXiao »

Hi

DFU reboot soft reset, the principle is realized by writing the PLL register to reset the PLL; first reset the PLL where the non-localtile is located, and then reset the PLL where the localtile is located.
as to 216 there is one PLL,that is to say you only need reset once, either reset tile0 or tile1 should be ok.

now i am trying to delete the audio ports, but dfu failed when i just delete a few of them.
Function_Block_Diagram.jpg
as the function block diagram upside, the function in red circle is what we need, it seems the dfu function should be ok when i delete all the other parts. but dfu failed when i just delete just a few of audio ports.
any ideas?
You do not have the required permissions to view the files attached to this post.
TonyXiao
Active Member
Posts: 44
Joined: Fri Mar 29, 2019 3:58 am

Post by TonyXiao »

Hi all

Now the audio ports only left the PORT_I2S_BCLK can not be deleted.
<!-Audio Ports->
<Port Location = "XS1_PORT_1H" Name = "PORT_I2S_BCLK" />

as long as the following p_bclk is commented out, the DFU function fails.
firmware stuck in such if inside sentences:
/* If running in application mode stop audio */
/* Don't interupt audio for save and restore cmds */
if ((DFU_IF == INTERFACE_NUMBER_DFU) && (sp.bRequest != XMOS_DFU_SAVESTATE) &&
(sp.bRequest != XMOS_DFU_RESTORESTATE))
{
printstrln("runs to here 0");
// Stop audio
outuint(c_audioControl, SET_SAMPLE_FREQ);
outuint(c_audioControl, AUDIO_STOP_FOR_DFU);
// Handshake
chkct(c_audioControl, XS1_CT_END);
}