How to exit the dfu mode?

97 views
Skip to first unread message

Aleš Pogačar

unread,
Sep 27, 2017, 6:46:22 PM9/27/17
to pixy_firmware_sdk

Hi everybody,


I have been playing around with pixy and I want to learn how to upload firmware with other tools, not pixymon. I came accross LPCScrypt and I can successfully program the SPIFI with pixy_firmware.hex, but I am later not able to run the default program just by replugging the USB.


Just to make it more clear. In the first plug in when i hold down the button the flash light goes on and I am able to upload the pixy_firmware.hex with LPCScrypt since pixy is in DFU mode. But the flash light remains, when I replug the usb cable without pressing the button. And the pixy default program is not running.


Any suggestions?


Best, Ales

Rich LeGrand

unread,
Sep 27, 2017, 6:55:17 PM9/27/17
to Aleš Pogačar, pixy_firmware_sdk
Hi Ales,
Bear in mind that Pixymon uploads a special program called "pixyflash"
into Pixy via DFU -- Pixy then uses this program to send data over USB
and program the firmware file into SPIFI. I'm not familiar with
LPCScrypt, but I'm guessing it targets onboard flash(?) instead of
SPIFI, of which there are many types and there is an annoying amount
of incompatibility between SPIFI flash parts and their programming
methods.

What are you trying to accomplish? The source code is available for
PixyMon, including the DFU firmware upload code.

--rich.
> --
> You received this message because you are subscribed to the Google Groups
> "pixy_firmware_sdk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pixy_firmware_...@googlegroups.com.
> To post to this group, send email to pixy_fir...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pixy_firmware_sdk/94ea2fce-5646-4302-9042-2b190f8c107f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Charmed Labs
www.charmedlabs.com

Aleš Pogačar

unread,
Sep 27, 2017, 7:26:09 PM9/27/17
to pixy_firmware_sdk
Hi Rich,

Thank you for quick answer. where does it store this pixyflash? in ROM? I thought this pixyflash is already incorporated in the pixyboard.

I have used the grey shades algorithm from Sandre from this thread https://groups.google.com/forum/#!topic/pixy_firmware_sdk/RLdfueOWKxE and adjusted it to move the pan tilt (since Sandre's algorithm moves the brugi mechanism and not pan tilt). I have compiled this adjusted code with gcc (LPCXpresso) and now I am testing to upload the original pixy_firmware.hex (yours) with LPCScrypt to see if it works. If it works I plan to upload Sandre's firmware (adjusted by me), to see if it works or if it is not compatible, via LPCScrypt (since the upload of Sandre's is not possible via Pixymon - it gives the invalid address range issue). 

It seems like it uploads the firmware nicely. There is a command in LPCScrypt which verifies wheather the firmware has uploaded successfully and there seems not to be any issues. LPCScrypt uses a command which programs to SPIFI directly - the command is lpcscrypt program ..\images\pixy_firmware.hex SPIFI. It seems like a really useful tool. The issue is like I described, that I cannot run default program after replugging the pixy. There has to be some way to exit this mode and start executing the default program of Pixy. Because from what i have been reading, pressing down the button before plugging the USB to enter the DFU is the NXP thing. 

Do you think it would be easier for me to incorporate the Sandre's proggreyshades.cpp into your alpha gcc version of firmware and upload it via pixymon, rather to do it like I did (so Sandre's version is built on pre-alpha gcc code with some debugging from his side - apparently he made the code work somehow - and then I have included the rcservo files and used the update function for keeping the changes in the picutre in the center of the frame)? Or you think it will be very difficult to that and take care all of the dependencies in the code on top of the possibility of compiling issues with the inserted program?

Aleš Pogačar

unread,
Sep 27, 2017, 8:00:59 PM9/27/17
to pixy_firmware_sdk
Just as an attachment. The code in the CLI for LPCScrypt. You can see that it should work - the firmware works when uploaded through pixymon. Similar as your code the scrypt boots the RAM with "LPCScrypt_158.bin.hdr". But now I guess I need to exit somehow this mode. How do you do it with Pixymon? Please do not miss my previous message :) that is the more important one

Thanks again
LPCScrypt.png

Aleš Pogačar

unread,
Sep 27, 2017, 8:42:48 PM9/27/17
to pixy_firmware_sdk
Hi again, 

Ok. I have now discovered that LPCScrypt works only with binary files. So sorry for that. But this brings me to my second message: How do you think is best to upload the Sandre's code adjusted by me to pixy? Or your alpha gcc code adjusted with the proggreyshades.cpp file?


Rich LeGrand

unread,
Sep 28, 2017, 10:45:03 AM9/28/17
to Aleš Pogačar, pixy_firmware_sdk
HI Ales,
Pixyflash is loaded into RAM via the DFU. If LPCscrypt programs
SPIFI, it will also upload a small program into RAM so it can program
the SPIFI flash device (because there is nothing on the LPC4330 that
knows how to program SPIFI.)

But I should also say that I don't know what Sondre's program does.
He may have just made a RAM target instead of a SPIFI flash target. A
RAM target uses something like a JTAG tool to put the program in RAM,
and then executes it. A SPIFI flash target (like Pixy's firmware)
puts the program content on SPIFI, then some simple runtime code
copies it to RAM upon power-up so it can be executed quickly (much
quicker than executing out of flash). It's a subtle, but important
difference.

My guess is that Sondre's program a RAM target and it's giving an
address range error because it's not writing to flash -- it's writing
to RAM. That may also explain why you need to execute the program
manually. A flash program will execute automatically upon power-up.

Anyway, the way to find out is figure out where the program is being
written to (what addresses).

--rich
> https://groups.google.com/d/msgid/pixy_firmware_sdk/5bf121fc-df35-49f4-8fc0-c6ec70f6311f%40googlegroups.com.

Aleš Pogačar

unread,
Jan 6, 2018, 4:52:09 PM1/6/18
to pixy_firmware_sdk
Hi Rich,

Its been a while. Since your last reply I have managed to update your code which compiles with gcc and included a program of Sandre with pan tilt movement. The movement is very slow but I get the pixy to move in the directions I want. I uploaded the new firmware via pixymon. Now the default and the only program on pixy is motion tracking as developed by Sandre - so when i click the default program button on pixymon this program runs (without the video). The motion is too slow and I would like to see though pixymon what is going on. Do you have any idea what would by the easiest way to see the video from the pixy while running this program? So when i will press the default program button, i will see the video which pixy records while tracking.

Thanks, Ales

Rich LeGrand

unread,
Jan 9, 2018, 11:17:40 PM1/9/18
to Aleš Pogačar, pixy_firmware_sdk
Hi Ales, 
Sounds like good work!  

I'm not sure what your frame data looks like-- is it frame-differencing?

Sending/displaying frame data is done by the various FOURCC types.  If you search for FOURCC in the code, you'll find the pixy firmware code that generates it and the PixyMon code that renders it.   You may need your own FOURCC type.  For example, the BA81 FOURCC is for raw bayer data (raw video).  

--rich

To unsubscribe from this group and stop receiving emails from it, send an email to pixy_firmware_sdk+unsubscribe@googlegroups.com.
To post to this group, send email to pixy_firmware_sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pixy_firmware_sdk/9a8fc4ba-3cc9-42a4-bc56-9f49f4f8de63%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages