Ultimate IMU _ LPC2148

Hi, I received the Ultimate imu using the LPC2148 and I was wondering how could i program it! Because I tried to load the code ( which is online ) using winarm and lpc21isp but without success… Maybe i have to buy a complementary card or something else…

The problem i got is that when i tried to load the main.hex, ater synchronizing there is no answer…

thanks for your help,

Try using FlashMagic to program the board:

http://www.flashmagictool.com

Select a low baud rate (e.g. 9600) until you get it working.

Read App Note 4 on the resources page if you still have problems:

http://www.flashmagictool.com/resources.html

Nujiklo, how did you connect it?

I don’t own one of these, but from the schematic it appears that the TXD0 and RXD0 pins from the uC are connected directly to the header - no level shifter. So, to communicate with an RS-232 port you will need an RS232 level shifter. Or perhaps it would be simpler to use the FT232RL breakout board.

Unfortunately, if you connected RS232 to the header, your RXD0 pin may be fried.

[Edit] Just noticed the [LPC Serial Port Bootloader Interface](LPC Serial Port Boot Loader Interface - PGM-00714 - SparkFun Electronics)

I have a home made RS232 cable that I connect to the COM1 port and on the other other side, to the gnd , txd0 and Rxd0 of the Ultimate imu module…

So if I understand, it can’t work for you??

Last week , I noticed this one : LPC Serial Port Bootloader Interface, that’s why I was wondering if I may needed another module to load the code. I hope I didn’t fry the pin…

So to sum up, do you think it will be ok if I buy the LPC Serial Port Bootloader Interface and I connect it to the Ultimate IMU I/O ?

Another thing… The LPC Serial Port Bootloader Interface is for the LPC ARM series ICs that have the Phillips bootloader but the Ultimate IMU doesn’t have it so I don’t know if it is, in fact, a good idea to buy this module… I read some tutorials about writing our own bootloader so I don’t think it is complicate to do it but I just want an advice to go on …

Thanks for the answers :slight_smile:

The LPC2148 has bootloader code on it. You do not need to write your own bootloader. You just need to make sure that you have a suitable RS232 interface between your board and your computer.

The LPC interface I mentioned should work for this particular application. But now that I look at it again, it is more expensive than the [FT232RL breakout. The FT232RL would probably have more potential uses.](SparkFun USB to Serial Breakout - FT232RL - BOB-12731 - SparkFun Electronics)

Ok thanks! I guess I confused bootloader and USB bootloader? because in this tutorial http://www.sparkfun.com/tutorials/94

the LPC2148 seems not having the USB bootloader code on it.

I’m in France so I try to look for the same RS232 interface on French suppliers because if I order from sparkfun, it may take a month before the product arrives but french suppliers do not have the same “devices” at all and I’m kind of desesperate …

I was wondering , maybe this one can be a good compromise :

http://www.gce-electronics.com/nos-prod … rs232.html

it is a RS232/TTL converter 5V and 3.3V and enables to add a RS232 port to a microcontroler very easily, it incorporate a MAX3232…

Finally, I found the LPC BootLoader Interface on a french website :slight_smile: , I will now try to found the other interface you proposed if you think it is better !

Another question (maybe the last one :slight_smile: ) , cfb, you told me that the LPC2148 has bootloader code on it, what does that mean exactly ? If I well understood , a bootloader is a sort of program that the microcontroller run after a reset? But what is the difference between this bootloader (of the LPC2148) and the USB one ?

I’m using WinARM and I dowloaded the code which is online( for the ultimate imu) to run some first tests but to load the code, I have to use the RS232 connection? except if I use the USB bootloader , I think I can just paste the right file on the SD card…

Sorry for all of these questions but your answers helped and will help me a lot :slight_smile:

Ok I think I will buy the LPC bootloader interface because the RST and BSL pins are taking in account in this module so no need to add a switch to deal with these pins. I will work with the ISP mode so I think this interface will be the easiest for me…

To resume the principle of programming the Ultimate IMU if I use this interface (tell me if I’m wrong… )

I compile, then I load the code using WinARM and lpc21isp ( I connect GND LPC bootloader interface-> GND Ultimate IMU, TX LPC bootloader interface-> RX Ultimate IMU and RX LPC bootloader interface-> TX Ultimate IMU ??? I have to cross TX and RX right?? ) . Once the code is loaded, I change the mode to be in Run mode and normally the Ultimate IMU has to run the previous loaded code ?

Nujiklo:
cfb, you told me that the LPC2148 has bootloader code on it, what does that mean exactly ? If I well understood , a bootloader is a sort of program that the microcontroller run after a reset?

The LPC2148 has a built-in bootloader which loads the code to program the flash memory via the LPC2148 UART and an RS232 connection. The other bootloader you mentioned loads the code via a USB connection so it is faster. I recommend you try the simpler built-in system first.

The built-in bootloader operation is described in detail in Chapter 21: Flash memory system and programming in the LPC2148 User manual (UM10139). If you don’t already have a copy download it from:

http://ics.nxp.com/support/documents/?search=UM10139

Ok thank you, I already have the user manual but I will dig into it more!

If the interface you purchase is the same as the Sparkfun one, then you are correct about the crossover. You’ll need all six connections:

  • - gnd <--> gnd
  • - Rx <--> Tx
  • - Tx <--> Rx
  • - VCC <--> VCC
  • - RST <--> RST
  • - BSL <--> BSL
  • The LPC2148 only runs the bootloader if P0.14 is held low after reset. That is the purpose of the BSL line. To run your code after programming, you must set the switch to release BSL and then reset the uC. (You may have to reset by removing power - not sure.)

    The interface has no power of its own, so you’ll have to get VCC from your IMU.


    I’ll make some additional guesses. These may be wrong, so check elsewhere if you can.

  • - It appears Ryan Owens has included the compiled and linked code as FW.SFE. It is in .bin format. So you don't really need to compile the project in order to test it.
  • - So, you should not need WinArm at first, just Flashmagic or LPC21isp.
  • - Apparently messages (debug messages at least) are printed to uart0 (the same header) at 9600 baud. You could see those with a terminal program (after setting the switch on your interface board to the other position).
  • - I just glanced briefly at the code but didn't see anything that looked like a secondary/USB bootloader. So I think you'll have to add that yourself. :) But I've not looked at the logomatic code so I didn't really know what to look for.
  • - It looks to me like Ryan Owens at Sparkfun has done a *lot* of work on this code, and has not gotten a tremendous amount of feedback. I'd think he would be eager to answer your questions if you could hook up with him via IRC or email. (Unfortunately I'm not 100% sure how to go about either.)
  • hsutherl:
    It looks to me like Ryan Owens at Sparkfun has done a lot of work on this code, and has not gotten a tremendous amount of feedback. I’d think he would be eager to answer your questions if you could hook up with him via IRC or email. (Unfortunately I’m not 100% sure how to go about either.)

    His email address is listed here: [https://github.com/ryowens84](https://github.com/ryowens84)

    Thanks a lot for all of these answers/advices… It will help me a lot ! I am waiting for my order now and I hope it will be fine :slight_smile: !

    I wrote two weeks ago to Ryan Owens but he didn’t answer, maybe he is too busy … Anyway I can give it another try :slight_smile:

    Just to say that I’m now able to program my µC so thanks a lot for this problem :slight_smile:

    Hi there…

    Despite Ryan of Sparkfun working on this Ultimate IMU and delivering high quality feedback, my guess is that Nujiklo should write a quick and dirty beginners guide of this IMU, just as it’s unboxed.

    Or who ever got it already working…

    Cheers!

    :smiley:

    Just got my Ultimate IMU today and after some work I was able to get it going (still some problems, see below).

    Here my first impressions (this is what I would have liked to know before buying it, hope it helps somebody):

    -as it comes out of the box it contains an old firmware which is pretty much useless. If it can write to the card (max 2GB in FAT16) then it starts recording data, otherwise you get an “sd card initialization failed”. To get the output it’s pointless to use USB (at least I wasn’t able to get it working), but I used a FT232RL at 9600.

    -seeing that the code in github is updated I wanted to install it. This is what I needed to connect from FT232RL to uIMU:

    GND ↔ GND

    RX ↔ TX

    TX ↔ TX

    DTR ↔ RST

    To enter the programming mode you just need to ground BSL.

    To program the uIMU on Windows you need to download flashmagic.

    You set the correct MCU to LPC2148, you set speed to 9600 and you need to set the oscillator speed to 12.000 (spent few hours on this one!)

    Once it’s all set you select main.hex (you get the main.hex if you compile the code you get from github with winARM)

    After this you will be able to select which data to record and if you want raw or euler data. Unfortunately you cannot select frequency.

    Now here’s my question: if I look at the main.cpp on ryowens code I see:

    //If a USB Cable gets plugged in, stop everything!
    		if(IOPIN0 & (1<<23))
    		{
    			VICIntEnClr = INT_TIMER0 |INT_UART1;	//Stop all running interrupts			
    			main_msc();					//Open the mass storage device
    			reset();						//Reset to check for new FW
    		}
    

    So I would expect the uIMU with new firmware to behave as a mass storage device and being able to update the Firmware if I upload the correct filename. Unfortunately I am unable to get any of these ( I tried on multiple pcs), all I get is that the recording is stopped, indicated by the blue led being off.

    Anybody with an updated uIMU is able to see it as mass storage device and update FW via USB?

    Thanks

    Ferrari

    PS: (update) with the new firmware it’s possible to reprogram it just by copying the FW.FSE into the uSD and then turning the board on.