Kabron Posted December 15, 2016 Report Posted December 15, 2016 Hello, Joel. I tried to reproduce the example for PSOC 4 CY8CKIT -049-42xx. Application generated OK, but build stage I got various errors concerning invalid registers. These errors refers to some .s files that do not exists anywhere. And each build attempt I got different names of these files. E.g. cch53yPh.s at first build, ccabGOXB.s at second attempt, cc4TpoIF.s at 3rd, etc. Just simple compiling gfx_mk.c file gives these errors. It is rather strange, from the cross-platforming declared. These files also figured in gfx_mk.lst with location at C:\Users\me\AppData\Local\Temp\cc4TpolF.s. in log file I found: C:\Users\vlady\AppData\Local\Temp\ccXqd6To.s: Assembler messages: C:\Users\vlady\AppData\Local\Temp\ccXqd6To.s:837: Error: invalid register list to push/pop instruction -- `push {r4,r5,r6,r7,r8,r9,r10,r11,lr}' C:\Users\vlady\AppData\Local\Temp\ccXqd6To.s:838: Error: lo register required -- `str sp,[r2,#20]' C:\Users\vlady\AppData\Local\Temp\ccXqd6To.s:839: Error: lo register required -- `ldr sp,[r3,#20]' C:\Users\vlady\AppData\Local\Temp\ccXqd6To.s:840: Error: invalid register list to push/pop instruction -- `pop {r4,r5,r6,r7,r8,r9,r10,r11,pc}' C:\Users\vlady\AppData\Local\Temp\ccXqd6To.s:865: Error: invalid register list to push/pop instruction -- `push {r4,r5,r6,r7,r8,r9,r10,r11,lr}' C:\Users\vlady\AppData\Local\Temp\ccXqd6To.s:866: Error: lo register required -- `str sp,[r2,#20]' C:\Users\vlady\AppData\Local\Temp\ccXqd6To.s:867: Error: lo register required -- `ldr sp,[r3,#20]' I do understand that Cortex M3 and M0 are different, but I think that Creator have to resolve the cases. PS I found #define GFX_CPU and changed it to M0. But some errors remains: C:\Users\vlady\AppData\Local\Temp\ccS4O158.s:843: Error: lo register required -- `str sp,[r2,#20]' C:\Users\vlady\AppData\Local\Temp\ccS4O158.s:844: Error: lo register required -- `ldr sp,[r3,#20]' C:\Users\vlady\AppData\Local\Temp\ccS4O158.s:875: Error: invalid register list to push/pop instruction -- `push {r4,r5,r6,r7,r8,r9,r10,r11,lr}' C:\Users\vlady\AppData\Local\Temp\ccS4O158.s:876: Error: lo register required -- `str sp,[r2,#20]' C:\Users\vlady\AppData\Local\Temp\ccS4O158.s:877: Error: lo register required -- `ldr sp,[r3,#20]'
Joel Bodenmann Posted December 15, 2016 Report Posted December 15, 2016 Hello @Kabron, First of all: You should (and you will) definitely be able to run µGFX on your PSoC 4 CY8CKIT development kit. µGFX has been designed to run on anything and the Cortex-M0 processor is actually very well supported by µGFX. The *.s files that don't exist anywhere that you are mentioning sound like files that get generated automatically. The fact that they change their name each time suggests that they are just temporary files which you never should have to care about as a user. It's hard to say what's exactly failing here. The errors that you are showing would suggest that the project is being built using the wrong instruction set. However, the fact that this is a PSoC-Creator project for an official dev-board kinda minimizes this chance. The first thing that I'd recommend you doing is setting GFX_CPU to GFX_CPU_UNKNOWN. In case of the libc that comes with the PSoC-Creator compiler is not fucked up like some other ones it should allow you running µGFX with an unoptimized task scheduler. One question though: Are you using the copy of µGFX that was part of the example project from the download section or did you use a more recent copy? If you could provide us with a complete ZIP archive containing your entire project that we can just open and run we could look closer into this. However, that would probably take between 7 and 10 days as our agenda is currently full.
Kabron Posted December 16, 2016 Author Report Posted December 16, 2016 Well, changing to GFX_CPU_UNKNOWN dramatically improve the situation. Errors gone. I even could to draw something. BUT! uGFX is so resource hungry! Any attempt to wide the operation scope(add fonts, even the smallest, images etc.) fails in flash memory shortage. Obviously I'm loosing something. I attached modifed project. uGFX Demo.cywrk.Archive01.zip
Joel Bodenmann Posted December 16, 2016 Report Posted December 16, 2016 2 hours ago, Kabron said: Well, changing to GFX_CPU_UNKNOWN dramatically improve the situation. Errors gone. I even could to draw something. Glad to hear that you got it working. With that configuration it's using a generic scheduler which works on every platform that comes with a proper libc implementation. It's just less efficient but in your case you wouldn't notice any performance improvement compared to the dedicated Cortex-M0 implementation. However, we'd still like to fix this problem so if you could answer the question regarding whether you're using the copy of the µGFX library which comes as part of the PSoC 5 example project from our downloads section or whether you're using a different one would be helpful to us. Also, the RAW32 port (which is what you'd be using) got quite a remake in the latest release from two days ago. If you could grab the latest 2.7 release from the downloads page and try with that uGFX version whether setting GFX_CPU to GFX_CPU_CORTEX_M0 works that would be very helpful for us. 2 hours ago, Kabron said: BUT! uGFX is so resource hungry! Any attempt to wide the operation scope(add fonts, even the smallest, images etc.) fails in flash memory shortage. Well, that's quite a bad thing to say. µGFX is meant to be as small as possible. It's very unlikely that you will find a library with a similar set of features that will be smaller. External resources such as fonts and images are definitely what eats the most memory but µGFX has no control over that. Even the smallest possible fixed-size font that we designed ourselves requires almost a full kB of memory. You have full control over every feature and sub-feature that gets included in the finished binary through the configuration file. Every feature you turn on will require resources (ROM, RAM and CPU time). By default almost everything is turned off. There are of course features which use a lot more program memory than others. For example, circle and arc drawing functions will eat tons of program memory (comparably). The same goes for image decoders. Note that "tons of memory" here means something like 500 to 1'000 bytes. I checked the specs of the microcontroller on your development board and it claims to have 32 kB of FLASH. That's definitely getting tight once you start using multiple fonts and images especially as you probably have other things in your firmware as well. However, there are still several optimizations that you can do with your resources. For example, you can use compressed images. But given the fact that you're working with a comparably slow processor that doesn't offer a whole lot of RAM you definitely don't want to work with something as CPU and as RAM intensive as PNG images. RLE encoded bitmaps might be a better option here. For the fonts you can use the filter ranges of the font encoder to just pick those glyphs that you really need in your application to reduce the font memory footprint. Note that the online font converter only allows setting one font size. However, the offline version which you can find under /tools allows you setting any number of arbitrary font ranges. Furthermore, you don't want to enable things like kerning or unicode support if you don't use/want them. Other optimizations include basic things like telling your compiler to optimize for code-size but that's definitely not going to change anything for the external resources.
Kabron Posted December 16, 2016 Author Report Posted December 16, 2016 Thanks a lot for consulting, Joel! Step by step I"m making a progress. I could add fonts. As to version 2.7. I compiled the example with the exact the same settings as for 2.6. The result was 0.3% smaller size. When I set GFX_CPU to GFX_CPU_CORTEX_M0, the following errors occurred: ccSNwxqe.s:36: Error: lo register required -- `str sp,[r0,#20]' ccSNwxqe.s:37: Error: lo register required -- `ldr sp,[r1,#20]' ccSNwxqe.s:2595: Error: lo register required -- `str sp,[r0,#20]' ccSNwxqe.s:2596: Error: lo register required -- `ldr sp,[r1,#20]' so, some progress obvious.
Kabron Posted December 16, 2016 Author Report Posted December 16, 2016 (edited) Finally, I switched my application to work with uGFX. To my surprise and satisfaction, it draws 4x times faster than mine custom LCD driver. And memory requirement are quite similar. See it on picture. Thanks again! BTW I have a project similar to your remote display idea. Please, see these videos: Edited December 16, 2016 by Kabron
Joel Bodenmann Posted December 17, 2016 Report Posted December 17, 2016 We're glad to heard that you got everything up and running and that you like µGFX! We'll look into the issue with the Cortex-M0 specific scheduler issue the following days to further improve performance. If you'd like to tell us and the rest of the community more about your project you can post about it in the User Projects section of this forum. We're looking forward to see more!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now