write a bootloader for atmega328p [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have been searching around the web, but didn't find anything useful telling me how to start.
I have an Atmega328p. I think this is the easiest controller to start with for this kind of things.
I would like to write my own bootloader. Where should I start to write code for?

Bootloader is essentially a bare-metal program that is running on your micro, listening to one or more communication interfaces (Serial, SPI, USB or you name it..) with a specific protocol. Then, on the PC/programmer side there is a "client" software that can some binary (but not limited to) and send it using that protocol to the bootloader. Then upon reception the bootloader will store the received data in some known memory location and issue a "jump" (or "branch" or "goto" or whatever) to the start of that data, thus triggering execution of it assuming it is an executable code. So, you bootloader at very minimum should be capable of:
1) Using one of the communication channels
2) Implementing a specific protocol
3) Storing the received executable in some memory
4) Trigger the execution of that code
From here it's you implementation choice.

There is a PDF with an in depth discussion/explanation of the steps to write a bootloader for AVR:
http://www.avrfreaks.net/sites/default/files/bootloader_faq.pdf
This was the third hit in Google from searching "atmega write bootloader"

Related

Is there any library functions in C to check the Internet connection? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Can you give me a simplest method to check the Internet availability using a C program in Linux?
I have implemented a program to run the system command 'traceroute' in C. Before this I have to check whether the Internet connection is available or not. So can you suggest a method?
Short answer: no. Neither C nor C++ has direct knowledge of networking, or any built-in networking functions.
Depending on what 3rd-party libraries you are using, there may be something you can use, but that depends on the library, it isn't directly part of C.
I can imagine there are libraries out there that might try to ping some internal/external address, perform a name lookup, etc. But if you're on an isolated network, not having the ability to ping, lookup, or cross a firewall to get to a certain location may be perfectly valid, and doesn't indicate a networking problem.

Redirect messages directed at the GPU [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Is there anything as low level as that on any Linux distribution? My overall goal is to redirect the message (instruction) meant for the GPU.
That means I would have to be able to program a driver between the CPU and the GPU which redirects any message to where I'd like (like a packet sniffer, but for GPU instructions and one that would stop the info there).
Is there any native Linux support for this kind of thing? Where do I start and what OS is most recommended for this kind of access?
You would need to modify the GPU driver. There you can insert logging or whatever other redirection you have in mind. Since many graphics drivers on Linux are open-source, this should be possible for many graphics cards. But take note that it won't be portable--you'll need to write some separate code for each major variant of GPU you want to support.
If you have something more specific, like that you're trying to capture OpenGL commands, that might make things easier.

Connect, read, write to a device using TCP/IP in C [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Good day, I just want to ask some help about connecting to a device using TCP/IP and how to properly read() and write() command to it.
Any sample codes or references would be a very big help. I don't have any idea in this particular matter but I have some knowledge in C programming and serial ports.
By the way, I'm currently using ubuntu. Thanks
I do not know what you mean by device (any device located in /dev?), but here is a tutorial on c sockets using write and read:
https://vcansimplify.wordpress.com/2013/03/14/c-socket-tutorial-echo-server/
If you would like to gain access to a device in /dev then you just need to open it like a file and also treat it like a file (read / write from it like you would from a file).

I need information about writing a device driver for microcontroller [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
i am bit confused between device driver and source code. what is the necessity of device driver.for eg. suppose i want to interface LPC2148 to LCD so do i need to develop driver for it?? or i need to write only a source code.
When it is required to write device driver for microcontroller.
and what is meant by linux device driver? do i need to port linux kernel in microcontroller?
is there any resource on internet, or any book from which i can learn these all things?
Thank you friends.
Source code and device driver are two different things..
device drivers required for controlling the device ...in case of micro-controller device drivers are used for accessing registers, bit wise functionality and ports in general...
source code can be for any software -written in low or high level language.
on the question of device driver-- many times driver is provided in linux or available from device manufacturer...u don't need to write device driver unless u r a developer or making a project...
there are many resources available on the internet for interfacing any micro-controller with lcd...just google it..
hope this helps...
cheers and regards dip-ak

AT91SAM7X-EK Evaluation Board [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I just recentely started working with a new board: a AT91SAM7X-EK. I would like to get more information about the board's processor (AT91SAM7X256) and the board's flash. So I looked at a pretty detailed data sheet and a summary of the data sheet, but have been unsucessfull (so far) of finding the information I want. I would appreciate if anyone could help me on the following aspects of the board:
How do I connect to the board? Is it through ssh? If so, how is it possible to recuperate the board's IP address. I have an ethernet cable for the connection.
How do I load an application onto the board's flash? For example, I would like to cross compile (using a toolchain I've already installed - arm-none-eabi) a simple hello world program in C to load onto my board. How would I go about doing so?
I would appreciate any help on this issue.
The board is supplied "bare-metal" - no code, no OS. You will not be able to run Linux on an AT91SAM7X-EK - it has insufficient memory resources and rins at 30MHz tops (and has no MMU).
You need a hardware JTAG or DBGU interface device and a tool-chain that will work with it.
You should probably also be looking at the datasheet for the board itself. From the Getting Started section of that:
The AT91SAM7X-EK evaluation board is delivered with a DVD-ROM containing all necessary
information and step-by-step procedures for working with the most common
development tool chains. Please refer to this DVD-ROM, or to the AT91 web site,
http://www.atmel.com/products/AT91/, for the most up-to-date information on getting
started with the evaluation kit.
So start there.

Resources