2008-12-26 02:44 PM
Need some help creating an IAP app
#iap #bootloader #upsd32532011-05-17 03:04 AM
Icebell,
You've understood correctly what I was saying in my example above. The common code was in 0x0000-0x7FFF and the banked code was in 0x8000-0xFFFF. What you might not understand is that it doesn't HAVE to be that way. The REALLY GREAT thing about the uPSD is that you can map any of the memory anywhere you want. The REALLY BAD thing about the uPSD is that you can map any of the memory anywhere you want. :) (If the English loses you, that was a joke). It's very easy to implement any type of ''memory-map'' you like, but since anything is possible, it can be very difficult to design a memory map that suits your needs. Here are some questions: How big is your MAIN application going to be? How will your MAIN program be updated? By the user? Will your ISRs ever need to be updated? Answers to these questions will help me shape up the last post I make to try to describe how to implement IAP from all this.2011-05-17 03:04 AM
Hello again!
I will try to answer quickly to your question How big is your MAIN application going to be? Well, my main app is goinf to be like almost the 256kBytes, well in fact it is now, I don´t know were to look the whole size of the program but I hace code in each of the 8 banks and most of them are full. How will your MAIN program be updated? By the user? Yes, it will be updated, surely it will often updated, and it may be probably updated by the user. Will your ISRs ever need to be updated? Sorry, but I don´t konw what ISR is, but I suppose it must be something inside the uPSD, and inside my uPSD only will be the main program and the iap program, and both of the will be updated. Thank you for all your explanations, including the ones refering to the English language. Best regards Icebell2011-05-17 03:04 AM
Icebell,
Wow. You have selected an extremely difficult situation for your first project. Let me just get this one piece of information out of the way now: If you are going to have nearly 256kB of code and a separate bootloader, both of which need to be updated in-application by the user, you might have selected the wrong chip (ie a simple 8051 derivative) for your application. That said, it can be done, but I'm worried the description of how might be a bit too much for you. I won't have time until probably later today or Monday to type up my next installment, but I'll get back here eventually!2011-05-17 03:04 AM
Sorry, maybe the size of the main program is what appear in the compilation, it says ...
... data=36.6 xdata=16322 code=211345 I hope it helps. Icebell2011-05-17 03:04 AM
Hello icebell. I've been monitoring your messages with phaze, and havent jumped in because he's much at better explaning things. (Side note: thanks again for everything phaze, our product is awesome thanks to your assistance.)
ISR - Interrupt Service Routines. Your ISR's must be common to all banks (0-0x7FFF) so that they can be serviced while the chip is in any bank. I think phaze asked about ISR's because you've mentioned that both your main and IAP programs must be reprogrammable. The memory map you're using (the example posted some time ago) might not support that functionality. I don't know the specs of your program, but my suggestion would be to create your IAP program so that it never has to be changed. The IAP program could only exist so that you can reprogram the main application over and over again. This way you can design the IAP program and the PC IAP interface program just once, no further support required. I distributed my PC IAP-reprogrammer program to all customers and have issued many main program revisions to date. 255KB of code space is amazing. My program is packed with functionality and only uses half that. I can only imagine the hours you've put into this. Some time ago I helped someone out by sending them a zip file containing some example files from my application. I removed all proprietary code, comments, and references. What remains is the guts of my IAP implementation, basically everything ever talked about in this forum from its creation. This would probably help you considerably and I would gladly send it to you too if phaze doesn't object. I don't want to post it here however because it is fairly large. Give me your personal email info and I will send it as soon as i can. P.S. Put some time aside to review all the info.2011-05-17 03:04 AM
Hello again,
Sorry for not being here before, but sometimes thera are urgent problems to solve, but I am here again, completely dedicated to iap. I have remapped my project like this: FS0 [00000 - 07FFF] 0 7FFF C:\MAIN_PROGRAM.h01 FS1 [08000 - 0FFFF] 8000 FFFF C:\MAIN_PROGRAM.h01 FS2 [10000 - 17FFF] 8000 FFFF C:\MAIN_PROGRAM.h02 FS3 [18000 - 1FFFF] 8000 FFFF C:\MAIN_PROGRAM.H03 FS4 [20000 - 27FFF] 8000 FFFF C:\MAIN_PROGRAM.H04 FS5 [28000 - 2FFFF] 8000 FFFF C:\MAIN_PROGRAM.H05 FS6 [30000 - 37FFF] 8000 FFFF C:\MAIN_PROGRAM.H06 FS7 [38000 - 3FFFF] 8000 FFFF C:\MAIN_PROGRAM.H07 CSBOOT0[40000 - 41FFF] 0 1FFF C:\IAP_PROGRAM.hex CSBOOT1[42000 - 43FFF] 2000 3FFF C:\IAP_PROGRAM.hex CSBOOT2[44000 - 45FFF] 4000 5FFF C:\IAP_PROGRAM.hex CSBOOT3[46000 - 47FFF] 6000 7FFF C:\IAP_PROGRAM.hex The main app works ok, if I put the startup.a51 file without any question about what must be executed, that is because the assambler code about that doesn’t still suit ok in my program. I am working with the file mulls14 attatched here, there are several things I don´t understand very well, I am trying to understand by myself the way it works, I am going to need some help about where to define the string to be checked before deciding if execute iap or main app, how to modified this string to return back to main app, well, I will write with more detail along today. Thank you again, now I understand perfectly my memory map, I understand why I could not make anything work defining main as data and boot as code at the beginning, my memory map was made without any sense and without any understanding, now I know what I have made, I can move like a fish in water by my memory map, but despite of this, maybe you think it would be better in another way, if you think that, please let me know I accept any suggestion you can make. Best Regards Icebell2011-05-17 03:04 AM
Thank you mulls14, now I can answer the question from phaze426,
Will your ISRs ever need to be updated? Yes, they will. My ISRs are in the common part, but the aren't the only thing that is there, there are another functions and code. All of this is put in the bank0, in the address 0000 to 7FFF. Is there any problem updating the ISRs? Is because if the iap code is not updated anf the main yes, it can be a problem if you change the ISRs? I have asked just now, and it may be posible not updating the iap program but we don´t understand why very well, it wouldn´t be posible to rewrite secondary memory executing a function from main flash? well I suppose it is not so easy, but I can see it now, sorry. Please mulls14, send me whatever you want if you think it may help me, my email ismailto:isabelbl@gmail.com
. See you soon Icebell [ This message was edited by: icebell on 17-01-2007 16:05 ]2011-05-17 03:04 AM
mulls,
No problem. Go ahead and send him the files. I certainly don't object. I haven't had time yet to draft my final installment, so maybe that will provide some stuff to look at until I get a chance to do so. By the way, do you mind sharing what product you actually ended up building and for what company? I just wonder if I've ever actually seen or heard of something that my input went into creating. :) -pHaze4262011-05-17 03:04 AM
icebell, the zip file is on its way... good luck!
Phaze, you've probably never heard of it but you can certainly take a look: - click on 'Mini EWG'. The picture(s) don't do it justice. It's my baby! (much thanks to you). It is our new Miniature Electronic Wheel Gage (EWG) measurement tool for the railroad industry. IEM patented this technology years ago and it has provided automated wheel measurement and data collection services to the railroad industry from coast to coast. It may not seem like it but this product is a big deal for many of the big railroads in the US and abroad. I've always wondered what other people are doing with the uPSD. Can you leak some of the interesting devices you've heard of?2011-05-17 03:04 AM
Don't worry phaze426, I have work to do, you have made things easier with your lesons, whenever you can I will be waiting for your next post.
Best Regards Icebell P.S. Sorry, but I must tell you I am not ''him'', I am ''her''.