I am working with a simple PIC18F2550 and I'm wondering about how to get a bootloader working on it. It's a very simple device with a USB port and CDC firmware. When I download Tiny Bootloader onto the pic, my PC doesn't recognize the device. Do I NEED to have a USB controller in my circuit in order for it to work? Such as the MAX232?
Would the same apply to the PIC32MX795F512L?
Thanks!
It is clear from the Tiny PIC boot loader documentation that it expects a UART connection rather than USB (that is what the MAX232 is for - it is an RS232 line driver).
You could simply do that and use an external serial to USB converter thus saving the code space required by the USB-CDC stack. Otherwise you will have to modify the boot loader code to use the CDC driver rather than the UART.
You will have to link the USB code with the boot loader, which will no doubt significantly increase its size. You may need therefore also to move the application start address to accommodate the boot loader. Furthermore, if the application needs USB comms, you may need a separate copy of the code in the application unless you provide a method of accessing the bootloader code from the application; which is possible, but not necessarily straightforward.
All that said, note the part at the end of the end of the page about extending the bootloader; On the face of it it seems unsuited to extension. Without looking at the code and its memory map, it is not clear why it has this constraint.
The PIC18F2550 has a USB interface built into it. It is called the "USB SIE" and there is a large section in the datasheet that documents it. If you make the right electrical connections, you should be able to connect your PIC18F2550 directly to a USB port without any active electronics between them. There is no reason you would need extra USB hardware just because you want to run a bootloader.
If you want to troubleshoot your problems with the bootloader, you should probably post another question with more details. It could be a problem with the PIC's configuration bits or something like that. I recommend trying to modify the bootloader to get it to blink an LED as a basic first step just so you can verify that you were able to get its code to run at all.
Related
Why would the file system (CIRCUITPY) of an Adafruit board running CircuitPython not show up when connecting it to a suitable host via a micro usb cable?
This happens to me often, usually when I am copying files via Windows, most often with my trinket which uses the integrated chip flash memory rather than the separate SPI flash chip. Why? I don't know. A bug somewhere obviously. :)
So the solution.
Always save your work files locally or use a source code solution like git
Switch to the boot mode (double click reset)
Drag the erase.uf2 file to clear the flash memory
Drag the circuit python uf2 file to reflash python
Restore your files saved on your PC
Basically, I've made it a habit to assume the flash memory is temporary and volatile and not store any critical code only there.
You can read more about the erase uf2 and reflashing, general troubleshooting here:
https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting
Besides your first answer about the cable, because of the relatively inexpensive nature of the boards and direct access to their power/ground sometimes the EPROMs that the file system are hosted on just go bad and give unexpected results. Best idea is to:
Test your environment with another board.
Reflash micro python on your board so you can start from scratch (didn't mention if you'd tried that).
JerryN mentioned the most common cause of this is using a USB cable with no data wires. Some USB cables are designed for power-only and have 2 rather than 4 conductors. These will power the device but will prevent mounting of the drive and use of the serial connection over USB.
Unfortunately these cables are often not marked as power-only so can be difficult to spot.
Another case is where CPLAYBOOT (this varies per board, e.g. GEMMABOOT, FEATHERBOOT, TRINKETBOOT) disappears on Windows. This can be caused by installation of the Arduino software which has an old, conflicting driver from 2007. More information on Adafruit: Circuit Playground Express: Troubleshooting.
A very rare case is a mis-seated USB connector. In my case the power was ok but the data wasn't for a good quality cable which had previously worked fine. Unplugging the USB cable at the host end and re-inserting it solved the problem.
I am developing an elevator GLCD display (128*64) with LPC2148 Micro controller, I have done program and PCB designing also. Now I want to upload the program to micro controller, how to do it? Before fixing micro controller or after fixing micro controller want to upload program?
If I understand correctly you want to program the device without using a bootloader or a JTAG. There is some standalone programmers available for the LPC2148 device. Example here. This will allow the MCU to be programmed before placing it on the board.
The maintainability of your design however raises red flags. You should at least have a JTAG header on the board even if it is not populated. JTAG is very flexible and cheap and add lots of development and testing options.
If I am right, than the LPC2100 series does have an ROM bootloader. You only have to pull a pin (I think P0.14) to ground while reset.
Flashmagic would than be a tool of choice to download the program.
Pro: No additional hardware needed.
Con: The bootloader pin and USART (normally USART0) need to be accessable.
1.Use the Keil compiler to compile your code and
generate hex file
2.Download and Install Flash Utility
3.In flash utility
Select Com port ,Board, Baud rate (may be default) and file
4.Now click on Upload to flash
I am supposed to pick (and may be implement) the firmware update protocol/software/procedure for the embedded device without USB and with limited program memory size. That device will work autonomously most of the time but once in a while a technician will be coming and updating the firmware.
What would be the most common choice for the update protocol if I wanted to use RS232 or CAN?
The requirements for the update are: complete after interrupted update (boot loader will be needed, I assume), small memory footprint, merge user settings with the newly introduced user data fields (in EEPROM), backup the previous version of the firmware with the possibility to roll the update back, safely update the boot loader itself.
It would be nice if the implementation of the boot loader and update client software existed already too (at least for Windows).
And just out of curiosity - are there any good alternatives to DFU for devices with USB?
Thanks in advance
I am not sure about "most common"; I am not sure anyone could answer that authoritatively or whether the answer is even useful. However I can tell you that I have implemented XMODEM-CRC/XMODEM-1K on a number of devices (ARM 7, ARM Cortem-M, PIC24, TI C55xx for example) in less than 4Kbytes. The bootloader sends an XMODEM start request on each port that is to support update, then for each port if a response is received within a short timeout (a few tens of milliseconds), then transfer continues. If no response is received the application is started normally.
complete after interrupted update (boot loader will be needed, I assume)
The approach I have taken is to not program the start address immediatly to flash on receipt but to copy it sideways and then program it last. The bootloader checks the start address on start-up and if it is 0xFFFFFFFF (i.e. not programmed) the transfer did not complete, and the bootloader restarts continuously polling for XMODEM start.
merge user settings with the newly introduced user data fields (in EEPROM),
In my case I have used Intel HEX files, but EEPROM memory is not commonly memory mapped. You could solve that by using a proprietary data format or set the address of the HEX data to an area that is invalid on the processor which the bootloader code will recognise as data to be sent to the EEPROM instead.
backup the previous version of the firmware with the possibility to
roll the update back,
That is a function of the bootloader implementation rather than the protocol. It of course requires that you have space to store two copies of the application. The unused copy could possibly be zipped, but incorporating decompression in the bootloader will increase its size. A perhaps simpler and least costly approach would be to have the bootloader support output of the current application image via XMODEM allowing the back-up to be stored on the host. However by doing that you are potentially enabling a third party to access your code.
safely update the boot loader itself.
Again that is a function of your bootloader rather then the protocol. If the code runs from RAM (i.e. the bootloader is copied from ROM to RAM and executed, then it is straightforward. In this case it is safest if possible to load the entire bootloader data into RAM before programming flash memory in order to minimise the time the target has no bootloader and so that sucessful programming does not rely on the host connection being maintained throughout.
If however the bootloader runs from flash, replacing it from the bootloader itself is not possible. Instead you might load an application that the bootloader runs and which replaces the bootloader before loading (or reloading) the final application.
It would be nice if the implementation of the boot loader and update
client software existed already too (at least for Windows).
Any terminal emulator software such as TeraTerm, Hyperterminal, PuTTY etc. will support XMODEM transfer. Implementing your own custom XMODEM sender is relatively straightforward with XMODEM source code widely available.
And just out of curiosity - are there any good alternatives to DFU for
devices with USB?
What I have done is implement a CDC/ACM device class USB stack in the bootloader so that it appears to the host as a serial port, and then used the same XMODEM code as before to do the data transfer. This increases the size of the bootloader; in my case to about 12kbytes. It was implemented using a stack and CDC/ACM (virtual COM port) app-note provided by the chip vendor. Strictly speaking for this you will need a USB vendor-id (VID) registered to your company; you should not use just any old ID.
SPI subsystem sitting between BCM7358 and SPI NOR flash use B-SPI module to perfrom read operation and M-SPI module to perfrom the write operation....If I have to perfrom read operation from M-SPI as an substitute of B-SPI...then how can I proceed....any suggestion are welcomed
You will need to find the programming information for the master spi interface, or else find a driver module compatible with your OS or example code you can crib from.
Assuming you want to do the access while your system is running rather than in order to boot from the SPI, what you want to do seems pretty reasonable so the chances of finding useful information are good.
If you are trying to do this to boot, you may need to boot a small bootloader from something else which can "manually" load an image with the master spi and then jump into it. Or else see if the chip has a mode pin combination or the like to boot from the master spi interface instead.
Essentially, if you made your own board and sourced chips without data sheets, you are in trouble unless you can find something else using a similar enough chip to crib from. Similarly if you are hacking a modification to a product without any source code. But if you bought an eval board or module, presumably you have access to some documentation or example code for the board, even if not for the chip.
I have this samsung chip on a board (samsung s3c2510a) and I want to program to it via some method. However, I don't have a jtag reader on me and this board has a usb port. Is there any way to tell if I can program to the chip via this usb port? I ripped the board off a color laser printer by samsung and the board also has an ethernet connection.
Also, this board has 4 pins called "cn4 debug". Would this be of any use?
Here is a pic: http://imageshack.us/photo/my-images/262/img20120527120306.jpg/
Thanks,
Rohit
I doubt programing this board would even be posible. You could check if there is any software that is used to update the board (from the manufactuter) and try to reverse the protocol. You would also need to figure out the format of the firmware file. There is a lot of good stuff on hacking router firmware that may help. You should be able to find some mailing list to ask for help on.
For any device to be programmed over USB or indeed any port that is not part of the on-chip programming/debug architecture requires software/firmware supporting that port to be present on teh chip already. Some microcontrollers include ROM based primary bootloader code for this purpose. The S2C2510A has no such bootloader. But if the board already has software on it, part of it may indeed be a bootloader. However unless you can get information on the protocol used, you do not really have much hope.
A picture of the board does not really help; what you need is a full data sheet and/or schematic. You'll also want the data sheet and user reference manual for the chip itself. You don't really have much hope of making sense of this board without them. The board does not look like a development board to me, so board specific information may not be available.
CN4 merely means "Connector Number 4". Having just four pins it is likely that it is merely a connecting to the Console UART - a minimal low speed serial data peripheral on the S3C2510A.