I am developing a product using LS1021A-TWR board which is "bare metal" (no Linux or other operating system). I am having a hard time finding the correct version of Code Warrior which supports this device. (There are TONS of variations of CW and it's confusing to get the right one! I have installed some that support other LS10xxx boards, but not this one.)
Additionally, I need to have the board support package (drivers) for a bare metal project so I can use the SPIFI, GPIO, etc. Ideally, I would just use the BSP with other development tools (not CordeWarrior), but I'll take what I can get.
Finally, can anyone point me to examples of bare metal programming of the LS1021A-TWR making use of the peripherals on the chip / board?
Thanks!
Stuart
Pavel, thank you for the response. I have previously downloaded CodeWarrior and can in fact build a bare metal application, but only one which is trivially simple. What I really need are drivers (BSP) so I can setup the hardware peripherals on the chip and the board. I know that such a BSP exists for Linux, but I cannot find one for a bare metal application.
So, restated in another way, in a bare metal application, how I can I configure the Quad SPI controller, clocks, GPIO, etc.? (I don't think the best answer is setting up all of the thousands of registers manually without the help of driver libraries!)
Thank you
stuartrubin -
Did you ever get any additional information? I am bringing up a board with an LS1012A and am struggling to find information on GPIO usage.
Thanks for any pointers you can provide.
.Tim
timhammer I have not, unfortunately. We started down another path - using U-Boot as a baseline, stripping it down, making a secondary program loader, etc., but that has proven difficult, and not really what we want.
If you just want to control GPIO, you might be able to slug your way through the data sheet and set the registers (direction, value, etc.) by hand. I think once you get into the more complex peripherals, it's extremely difficult to manage them without a BSP or drivers backing you up.
If anyone else (NXP people? ARM gurus?) has info, we would like it!
We have a bare metal framework that we provide for the LS1021A, LS1043A, and LS1046A in our Open Industrial Linux distribution - openil.org. You can find documentation on the baremetal framework here: https://www.nxp.com/docs/en/user-guide/IIOT_BAREMETAL_DG.pdf . It is based off of a uboot framework, and will provide you with a starting point.
Thanks also from me. I had come across that document a few times with different searches, but
I had not considered it would be much help.
However, now that I am falling back, and failing, to do simple GPIO I was hoping the example code would be helpful. The document refers to <industry-Uboot path>/app/ and several files within that directory (e.g. app.c, test_gpio.c), however, I am unable to find those files. I have cloned both u-boot.git and openil.git from openil on github and do not find that directory or the files that should be in it.
Can you tell me where to find them?
Thanks!
.Tim
Make sure you are pulling the Open IL uboot with the OpenIL-Baremetal-201803 tag. The apps directory was introduced with that release.
Jeff, thanks again. I tried to build the framework (U-Boot) using instructions in the PDF. This command from Section 2.3.1 fails:
$git clone https://bitbucket.sw.nxp.com/scm/dnind/industry-uboot.git
If you go to this URL https://bitbucket.sw.nxp.com, you get this warning:
"Access Denied
You are connecting to this service through the public Internet.
Access is currently supported only via NXP VPN or NXP internal network connection. If you are connecting from within the NXP network, please check your proxy configuration.
bitbucket.sw.nxp.com"
Perhaps there is an external version?
I also suspect that there may be a few steps missing, or at least left "as an exercise for the reader" in there!
Thanks
Stuart
Stuart,
Apologies, it looks like we kept an internal repository in our documentation by accident. We are correcting this now, but here are the corrected instructions:
/* building u-boot image for ls1021aiot board */
$make ls1021aiot sdcard baremetal defconfig
$make
Hi Jeff,
I am also trying to bring up TWR-LS1021a with the baremetal framework. I am successful in building and depoying U-Boot on master core and baremetal application on slave core. However, I am not able to connect UART to CORE1 to see the log messages from CORE1 (Baremetal application). Could you please give some hint?
Thanks,
Vamsi.
Jeff -
Thanks. I thought I had done that, but apparently did not get something quite right in the attempt.
Jeff, thank you for this information. Through all of my research I had not seen this!
The documentation does make it clear that the LS1021A-IoT board is supported in the framework. Our product is using the LS1021A-TWR board. Do you know what the effort would be to build for the Tower board? We’re not really using much of the board functionality apart from the QSPI Flash, so perhaps the effort is low.
The main thing is that we need to boot from QSPI Flash. Immediately following the boot, we need to issue some special commands to the flash device, and then proceed to the “real” U-Boot loader. All of your input it welcome!
Thank you
Stuart
I don't think it should be much effort, the TWR board is simpler compared to the IoT board, so you should mostly be removing items, especially given your focus on QSPI Flash. You can also use the Layerscape SDK as reference for the TWR board, that SDK supports the TWR board.
Based on your use case, I'm not sure the OpenIL code will add a lot, it was still booting to uboot, then allowing a user to run an application on bare metal on one of the LS1021A cores. I think that for what you are describing, modifying u-boot would still be the best option.
NXP LS1021a summary page contains information about Programmers, Debuggers and IDE. See the following page:
NXP offers CodeWarrior for ARMv7. This CodeWarrior supports LS1021a-TWR board. See attached file:
Have a great day,
Pavel Chubakov
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------