How can gem5 add peripherals, such as an SPI, IIC or network card, when simulating arm in the whole system - gem5

I read a lot of documents and didn't know how to add peripherals when simulating arm in the whole system. Now I'm very confused. I'm a novice of gem5. I hope you can give me some tips and help

Related

How can I learn to build my own bootloader for an embedded system?

Does anyone know of a good learning resource for building your own bootloader for an embedded system? From reading various textbooks, I have a good overview of what a bootloader is supposed to do, and some textbooks include snippets of assembler to show how the bootloader should be built.
However, when I search for resources/tutorials that describe how to build a bootloader, everything I've found so far is either too advanced, (assuming a knowledge of certain preliminaries and are thus hard to follow), or, they are dealing with creating a bootloader for a pc or an emulator. Ideally I'm looking for a single resource/book, that covers preliminaries, and walks me through the process. I'm happy to purchase a particular chip, and relevant cables, if the tutorial/textbook requires that.
The term bootloader is quite broad, so does your quest have roots in a few dozen lines of code with a serial bootloader or are you interested in a linux type full blown operating system (uboot) that has gobs of features and drivers and stacks?
If you dont already know that answer or dont know what I am talking about you need to figure that out, I would start small...even if you desire the huge monster operating system solution, you should start with bare metal (which is what a bootloader is, a bare metal program) chip comes out of reset, your code runs first, blinks an led. Then control the rate of the blinking led, then if you have a push button read the push button and make it change the led (demonstrating input and output). Then find and use a timer to blink the led if you didnt already (use polling first please, interrupts later). Now you can do clock math and have an idea how the chips clock tree is so use that to get a uart up, tx only first, then rx/tx echo what your receive. THEN you are ready to talk about your first bootloader, which should involve some serial protocol (invent your own or use xmodem or something) that actually "boots" and then lets you "load" other programs after booting.
You can do all of this (well virtual leds in some other form) using simulators, and that may not be a bad idea since the hard part of bare metal is first off controlling the assembler compiler and linker to make a binary that actually boots up and runs. Then piles of sub $10 and sub $20 boards that you can learn to write a bootloader for (msp430 launchpads, the other launchpads, stm32f0 and f4 discovery boards, the raspberry pi, probably not the beagles avoid those for now, oh and a myriad of avr based boards, avoid x86 start with microcontrollers, arm, avr, msp430).

how to port uclinux linux to any microcontroller

I have stellaris LM4f232 evaluation borad. I have ported free rtos , sysbios to stellaris lm4f232 board and successfully developed an gps tracking application . But I always wanted to port uc linux for my board . my question are
i) is there any material to port uclinux to any controller
ii)what are necessary knowledge I required to do the same
I have googled a lot . I did n't get the right information, but I have seen posts that its difficult ,but I cant able to realise the same .any help????
iii) what is the road map to achieve it , what are the knowledge I should need to achieve this
Linux, even uCLinux requires considerable memory resources; you'd want to start with at least 2Mb for the boot device and 16Mb of RAM (although a minimal system can be booted in as little as 4Mb). On a microcontroller, this means that you must have external memory.
Another issue is that Cortex-M devices are optimised to run code from on-chip Flash memory, having separate buses for ROM and RAM so that data and instructions can be fetched simultaneously. uClinux must run from external RAM, which has a detrimental effect on the performance, and you will be unlikely to achieve the 1.25MIPS per MHz figure the CM4 is otherwise capable of. It is possible to arrange for time critical code to be placed in on-chip flash is necessary, but it is of course a limited resource.
Some good advice on the issues of deploying Linux on a Cortex-M device can be found here
I would suggest to have a look on buildroot which as far as I know can be build for this board.
adding to #Clifford , you can use u-boot (bootloader) ,already configured for many boards ,if your board is not on list you can edit it.,

How to program on this arm

I have this samsung chip on a board (samsung s3c2510a) and I want to program to it via some method. However, I don't have a jtag reader on me and this board has a usb port. Is there any way to tell if I can program to the chip via this usb port? I ripped the board off a color laser printer by samsung and the board also has an ethernet connection.
Also, this board has 4 pins called "cn4 debug". Would this be of any use?
Here is a pic: http://imageshack.us/photo/my-images/262/img20120527120306.jpg/
Thanks,
Rohit
I doubt programing this board would even be posible. You could check if there is any software that is used to update the board (from the manufactuter) and try to reverse the protocol. You would also need to figure out the format of the firmware file. There is a lot of good stuff on hacking router firmware that may help. You should be able to find some mailing list to ask for help on.
For any device to be programmed over USB or indeed any port that is not part of the on-chip programming/debug architecture requires software/firmware supporting that port to be present on teh chip already. Some microcontrollers include ROM based primary bootloader code for this purpose. The S2C2510A has no such bootloader. But if the board already has software on it, part of it may indeed be a bootloader. However unless you can get information on the protocol used, you do not really have much hope.
A picture of the board does not really help; what you need is a full data sheet and/or schematic. You'll also want the data sheet and user reference manual for the chip itself. You don't really have much hope of making sense of this board without them. The board does not look like a development board to me, so board specific information may not be available.
CN4 merely means "Connector Number 4". Having just four pins it is likely that it is merely a connecting to the Console UART - a minimal low speed serial data peripheral on the S3C2510A.

I am fascinated by hardware boards and coding directly with the hardware. I want to start? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I am already a software developer, but daily business work is neither challenging not improving my skills.
I have no clue how this embedded things work, what are the setup needs to be done to even run hello world program.
So I am looking for very basic development board, which is support at C language.
not very complicated or high processing. As that would be over killing for a just beginner.
if I am able to understand how to handle a small device. I would learn other upper level board. As it is self paced and self teaching. I don't wanna jump over a complicated board as that happened to me once. I have having LPC 21xx board, well equipped. having good space to create program and run them.
But I was knocked out in the round zero. could not figured out more then plugging into computer and turn it on.
So suggest me simple board it would be great if it support usb as my laptop does not have serial port. if if there is nothing no issue, I hope there will be something usb to serial. :)
Please help. I really wanna learn it.
The arduino is very user friendly but in part because they hid the stuff you are trying to learn. You can still get down to the metal on an arduino though
The winarm guy has tons of example programs to get you started.
Sparkfun is the place to go in the US for most boards. right now the sam7-h64 is on sale, atmel has a util for covering the loading of the board problem. you can get an mbed there, now the maple is there, coridium armmite pro, and a plethera of arduino variations. And the msp430 launchpad. No matter what I recommend picking up one of the msp430 launchpad boards, only $4.30, very nice architecture, the usb cable (that comes with it?) is all you need.
Another TI product is the stellaris line of cortex-m3 based chips/eval boards. The 811 is easy to brick, I would avoid it, comes with everything you need. the boards are dripping with goodies, oled display, buttons, etc.
At some point you are going to need to get your feet wet with openocd. Amontek makes the jtag-tiny which is a very nice arm jtag wiggler. A number of the eval boards have ftdi chips on them which handle usb to serial and usb to jtag, googling will show tons of info on how to use openocd to connect to and load.
Another path is qemu. a stellaris board/chip or few and other chip families are supported, so you can cover the learning to compile/build the program as well as program some peripherals without having to figure out the loading part.
The atmel avr butterfly is still available for $20. Three wires shoved into a serial port connector and you can program the thing. Has things on the board to learn to program, etc.
I recommend not limiting yourself to one processor family (avr, arm, msp430, etc) nor one chip vendor (lpc, atmel, ti, etc). many of these boards can be had for under $50, some under $25 (look at the ez430 additional boards 3 for $10, the launchpad might be able to program them, otherwise the ez430 is $20). (most of the arduino family wants an additional usb to serial plus power, which almost doubles the cost, also be careful to note 5V vs 3.3V boards, so you dont melt anything down, really good idea to get a few of the different ftdi usb to serial breakout boards from sparkfun anyway).
I don't know if you've heard of Arduino... it's a great beginning hardware platform, programmed with USB in C++. Boards are only $30 so it's pretty cheap too.
stm32l-discovery 14$ for stm32(16kb ram + 128kb flash + 4kb eeprom) + stlink2 on board, you just need an usb-cable. Be sure to get l version, not vl, the l- has slower cpu but an lcd and some touch sensitive buttons. I was a normal c developer before, but found a job in an embedded market, where we use the same processor. In a month I never used any assembler and the experience was not much different than programming for pc except for you can't effectively use dynamical allocation. But that doesn't matter, since you control all the memory and timing and all the hardware for that matter. The iar kickstart tools are also great, especially the debugger - it is fast and you can even attach to the running process. The editor in the IAR IDE sucks big time though. It still doesn't support unicode in 2011 and things like "outline" in eclipse. Still the IDE is very nicely integrated with the hardware. You also got stdperiph. library from stm. It is a bit on the bloatware side, but you can mix and match the modules you like or choose to use raw registers if it makes the code more readable or smaller. Anyway, ask away, if you are interested in my experience. I also would advise against avr, becaus from the cost/performance ratio they are much worse than stm. I was porting a lot of avr code in the last month(avr's had some supply problem) and even if the avr had 16 Mhz and the stm32 had only 32, it much faster, much more configurable and has more periferials which are also easier to programm. Cortex-M3 controller are much nearer to the PC you dont have to optimize alot and 32bit wide words for calculation will spare you much pain. M3 are more comfortable to program with the things like bit banding and configurable interrupt priorities.

Development Kit suggestions

Working on a PoC of a project that streams data from USB via Wifi:
I need a development kit with WLan (preferably 802.11g) and HighSpeed USB device.
Don't mind the CPU type, memory size etc.
(Even a kit with only Ethernet 100M will do)
If anyone can recommend one or even suggest a place to ask, I will be most obliged.
Regards,
Murkin
If you're ok with linux and adding a third party wifi module, you might want to look at the ATSTK5xx. Mouser sells them for as low as eighty bucks and the wifi might run you another fifty. The Atmel FAE is probably a good place to start.
If you're willing to spend a bit more money, you might also look at buglabs.net and gumstix.com
I would look at the gunstix boards, and the beagle board. Both use linux and have various peripherals you can attach.
A little more expensive are the omap3530 eval board from LogicPD which I believe has wifi, bluetooth, and usb hw on the board.