tag:blogger.com,1999:blog-7822883683244244182.post99676631996245787..comments2023-05-08T12:42:54.728+03:00Comments on low tech: Introduction to ARM Cortex-M3 Part 2-Programmingmuxhttp://www.blogger.com/profile/07901500843676691342noreply@blogger.comBlogger29125tag:blogger.com,1999:blog-7822883683244244182.post-2791701924137884312013-08-31T02:04:24.486+02:002013-08-31T02:04:24.486+02:00I was recommended this web site by my cousin. I am...I was recommended this web site by my cousin. I am <br />not sure whether this post is written by him as nobody else know such detailed <br />about my difficulty. You are amazing! Thanks!<br /><br />My page :: slow booting computer (<a href="http://www.cleartechinfo.com/forum" rel="nofollow"></a>)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-81469821096057761402012-04-19T15:06:26.252+02:002012-04-19T15:06:26.252+02:00Thanks a lot! I managed to blink a led :) Would it...Thanks a lot! I managed to blink a led :) Would it be possible to have your liblpc1768 project with the startup and system code ? That would be extremely useful to me. Thanks again.rousselmanunoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-76755567603363435932012-01-26T22:17:08.660+02:002012-01-26T22:17:08.660+02:00I'm not sure that's even possible, I would...I'm not sure that's even possible, I would start with something more realistic, like a serial camera.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-31484010937815685942012-01-26T22:15:01.318+02:002012-01-26T22:15:01.318+02:00you're welcome :)you're welcome :)muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-25060379319104689012012-01-25T14:36:14.032+02:002012-01-25T14:36:14.032+02:00Ur blog got me started with lpc1768, thank you for...Ur blog got me started with lpc1768, thank you for this helping blog. <br /><br />I wanted to interface a web cam to lpc1768, could you help me with some initial direction, thank youRajeshnoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-75760907566483515912012-01-17T00:09:03.455+02:002012-01-17T00:09:03.455+02:00Great post Mux! Concise and full of info.
I don&#...Great post Mux! Concise and full of info.<br /><br />I don't have any problems for you to solve, just wanted to say thanks :-)Mikehttps://www.blogger.com/profile/07045530492555396259noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-52250874990968021712011-12-10T03:26:33.305+02:002011-12-10T03:26:33.305+02:00gemio, you'll need to install the CodeSourcery...gemio, you'll need to install the CodeSourcery toolchain and build the NXP driver library.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-91301039456552893342011-12-09T07:18:38.703+02:002011-12-09T07:18:38.703+02:00Hi,
I really enjoyed your post, and i am particul...Hi,<br /><br />I really enjoyed your post, and i am particularly interested in the SD card read/write.<br /><br />I downloaded the FatFs-SDC driver and compiled it. it returns with:<br /><br /><br /><br />file not found error.<br /><br />I have CMSISv2_LPC17xx in my workspace. Am i missing some toolchain?<br /><br />I am using lpc1768 with lpc_xpresso ide.<br /><br />please advise.gemionoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-2190356610955938452011-12-04T03:12:45.586+02:002011-12-04T03:12:45.586+02:00Actually, the comment should say 12.5Mhz:
158 ...Actually, the comment should say 12.5Mhz:<br />158 ssp_init(12500000); //12Mhz<br /><br />As to why f_sync always fails, I think it calls disk_ioctl which is not implemented, you could change disk_ioctl to return RES_OK.<br /><br />The highest frequency is 15Mhz for the LPC1769, but the higher the frequency the more susceptible it is to noise, especially that I'm not using the CRC.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-13753113363535198542011-12-03T12:43:48.519+02:002011-12-03T12:43:48.519+02:00Ok. Forget about my stupid question regarding 12.5...Ok. Forget about my stupid question regarding 12.5MHz - you explain that above. However I'm using LPC1769, which is 120MHz. Maybe this is the reason why 1 500 000 works (it is 1/80 of 120MHz). However 15 000 000 does not work. It crashes very fast on f_write. Tell me what you think.darklukehttps://www.blogger.com/profile/11081930614421620581noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-79236037636714281042011-12-03T12:05:09.463+02:002011-12-03T12:05:09.463+02:00Hi, Thank you for your reply. Changing the frequen...Hi, Thank you for your reply. Changing the frequency from 12500000 to 1500000 helps. At least now after 10 minutes I can open the file normally on my computer - the filesystem does not get corrupt or anything. <br />BUT the f_sync returns the FR_DISK_ERR all the time - every time I call it - and I call it once a second.<br />Also I will have to test the performance for both frequencies.<br />btw, why is 12500000 = 12mhz (not 12000000)?darklukehttps://www.blogger.com/profile/11081930614421620581noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-73323790581672396182011-12-03T06:01:17.642+02:002011-12-03T06:01:17.642+02:00Hi,
I will look into it, but for now, try lowerin...Hi,<br /><br />I will look into it, but for now, try lowering the SPI frequency, in disk_initialize, to say 1Mhz.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-4862710332689663032011-12-02T22:13:21.767+02:002011-12-02T22:13:21.767+02:00Hi, I'm trying to use your example code for my...Hi, I'm trying to use your example code for my lpcxpresso 1769. I'm particularly interested in the SD card part. I used the code you supplied and it compiled. Your example works but when I looked closed at it, the f_close function always returns FR_DISK_ERR. Also when I try to add f_sync - this function also always returns FR_DISK_ERR. Your example however saves the file to an SD card and I can read it on my computer.<br /><br />The problem is when I try to run the save function in a loop. I'm working on datalogger project and I'm saving data in a loop at constant frequency. This causes the saving to fail after some time. Last time I tried it took 10 minutes and the program froze at while(ssp_read() != SDC_RESP_ROK); in disk_write function in diskio.c file. When I took the card out and put it to the computer the file name was corrupt (ATA C.SV instead of DATA.CSV which I use) but the data was there. Other times the file system seems corrupted... <br /><br />I tried upgrading to fatfs 0.09 (I see you use 0.08a) but that doesn't help.<br /><br />Please help me if you have any idea what might be wrong...darklukehttps://www.blogger.com/profile/11081930614421620581noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-58703551808947108582011-03-03T09:37:53.047+02:002011-03-03T09:37:53.047+02:00hi Mux,
Have you been tried to port lwIP stack to...hi Mux,<br /><br />Have you been tried to port lwIP stack to mbed? We'd like to try to port it, it seems not that easy.. <br /><br /><br />Regards,<br />-Jinjin zhaonoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-5774569925551397422011-02-08T02:22:28.975+02:002011-02-08T02:22:28.975+02:00Mux,
I appreciate your reply. I tried your linker...Mux,<br /><br />I appreciate your reply. I tried your linker script but I got another error when compiling. There is something with my environment thats an issue here (i'm new to GCC). Right now I'm using the Debug Framework that ships with CMSIS and thats working fine enough for my needs at the moment (not having JTAG access on the MBED is a little bit of a pain). <br />When I get the time to investigate my setup further I'll let you know if I get it working.<br />Otherwise thanks again!<br />Nicknma550nhttps://www.blogger.com/profile/00229804781525176655noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-65457909140789606212011-02-05T11:29:26.523+02:002011-02-05T11:29:26.523+02:00Nick,
There are many working examples in the post...Nick,<br /><br />There are many working examples in the post, especially implementing _write, you could also use my linker script. If you're still having problems try hosting your code somewhere and send me the link.<br /><br />https://code.google.com/p/lpc17xx-ld/source/browse/lpc1768.ldmuxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-62537308579086207402011-02-03T05:07:15.275+02:002011-02-03T05:07:15.275+02:00Hi Mux,
I must say you have a very clear and info...Hi Mux,<br /><br />I must say you have a very clear and informative blog! I've been enjoying the read and have learned a lot.<br /><br />I am also having similar issues getting printf to work.<br /><br />Would it be possible to post a .tar.gz of a basic project where you implement _write and use printf?<br /><br />I feel that will help us know if we've got an issue with our Toolchain or environment.<br /><br />Thanks<br />Nicknma550nhttps://www.blogger.com/profile/00229804781525176655noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-57884196611696831852011-01-21T17:26:47.767+02:002011-01-21T17:26:47.767+02:00hi mux,
Thanks.
It works now, the problem is the ...hi mux,<br /><br />Thanks.<br />It works now, the problem is the static variable in .data and .bss are not initialized correctly. After add some code to do the initialization, it works fine. <br /><br />"_startup" function seems not provided by newlib, is it? did you met the same problem?<br /><br />For _sbrk(), it is implemented in syscall.c which also includes _write(), the library is libcs3unhosted.a. I reimplemented _write(), so did not link with libcs3unhosted.a, then _sbrk() should be added to my own source file. Some wrong here? Please suggest. <br /><br />Thanks so much again for your nice instruction.jin zhaonoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-85482295610599003952011-01-18T15:48:39.150+02:002011-01-18T15:48:39.150+02:00Jin,
First, _sbrk is not an I/O function it's...Jin,<br /><br />First, _sbrk is not an I/O function it's called by malloc to increase the heap, you don't need to implement it as it's already implemented and, this could be the source of your problems, furthermore, you don't need to implement anything else unless you need it.<br /><br />I'm not sure about the flags you mention, man gcc, you could check one of my Makefiles though.<br /><br />Finally, if you host your toolchain somewhere send me a link I could debug it for you with jtag.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-41457876013889441422011-01-13T18:40:18.533+02:002011-01-13T18:40:18.533+02:00hi Mux,
Thanks so much. I found another thing th...hi Mux, <br /><br />Thanks so much. I found another thing that malloc doesn't work also, it seems hang or corrupt when call it. I guess that print() might related to this. <br /><br />I have some basic questions, could you help to explain it if you have time?<br />1. Normally, we need implement those low level I/O function(such as "_sbrk/_write/_read/_fstat/...") but not link with libcs3unhosted.a for a specified device. Can we just put these functions all in a file together with application?<br /><br />2. Should these "-nodefaultlibs -nostartfiles" flags added to LDFLAGS? I am quite sure about this.<br /><br />3. About _init() function, in my testing I found that "-lcs3" is necessary to be linked, and I have to manually add "Sourcery_G++_Lite/lib/gcc/arm-none-eabi/4.5.1/thumb2/*.o" for "_init()" function. Is it correct?jin zhaonoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-30700545554799905112011-01-13T17:40:24.249+02:002011-01-13T17:40:24.249+02:00Jin,
yes it's okay I guess, If you have the t...Jin,<br /><br />yes it's okay I guess, If you have the toolchain hosted somewhere, I could take a look at it.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-29342883832813075192011-01-13T06:49:08.563+02:002011-01-13T06:49:08.563+02:00hi Mux,
I directly include _write() in the main.c...hi Mux,<br /><br />I directly include _write() in the main.c and remove -lcs3unhosted in the GROUP(...) of lpc1768.ld. <br />Compilation is ok and it is no problem to call _write(0, "hello", 5), but printf() seems hang or corrupt.<br /><br />Is it ok to directly include _write() in the my test program?jin zhaonoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-83439610147709614002011-01-13T03:11:28.679+02:002011-01-13T03:11:28.679+02:00Jin,
yes printf calls _write to do the actual out...Jin,<br /><br />yes printf calls _write to do the actual output, if _write is working and printf is not, then it's probably using libc's _write and not your override, make sure you copy _write exactly as in the example.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-32202609204448822462011-01-13T02:25:13.108+02:002011-01-13T02:25:13.108+02:00hi mux,
Thanks so much!
"_write()" do ...hi mux,<br /><br />Thanks so much! <br />"_write()" do works with your lpc1768.ld. It is really great helpful to us. Thanks again.<br /><br />I tested printf() also, it seems not work yet. Is "_write()" be called by printf() internally? If _write() works, will printf() works too?jin zhaonoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-22259839942149761162011-01-13T01:53:48.788+02:002011-01-13T01:53:48.788+02:00Jin,
I used CodeSourcery's linker script, but...Jin,<br /><br />I used CodeSourcery's linker script, but modified it a little bit, you can find it here:<br />https://code.google.com/p/lpc17xx-ld/source/browse/lpc1768.ldmuxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.com