Wednesday, February 21, 2018

Embedded System Interview Brush Up.

These are the question link I am preparing. Just want to prepare a one stop link to all the people who want to brush up before you get start a new job search: 
 I am planning in to put answers also. Not sure when I will get to that.

If you would like to add any topics you can add it in comments I will add on to my list here. You can answers too if you like.

First trying to get the "oneliners" and "oh.. yeah I knew that". Just treat it as a test of our knowledge, if you don`t know google it.
Any list is never complete so I leave it up to you to follow these questions: 

Questions are for beginner to intermediate level folks.

I plan to make the following questions segregated: so as of now bear with this:

What are the basic protocols in a micro contrller?

What is AHB?
What is APB?

What is bus arbitration?

What are the level of bus arbiter?

How is SRAM interfaced?

How is that shown in the final.map?

What are the pheripehrals of the microcontroller?
Where does the peripheral data get stored in the microcontroller?
What is that latency of the peripheral to SRAM with MPU transfer and DMA transfer?

What are the limitations of DMA? Can we over use DMA and not use core at all?

What are the basic peripheral protocols in a MCU?
What are the communication interfaces of the ARM core with peripherals?





What is direct memory accessing?
What is indirect memory accessing?
What is the size of an enum variable?
What is NVIC?
What are the interrupt priorities in an NVIC for STM32 or any other mcu?
What is masked interrupt?
What is a non-maskable interrupt?
What is a software interrupt? How can you generate a software interrupt? Where does it get called?
What is NOR-flash?
What is NAND flash?
What are the differeces between the 2 flahses?
What is NVMe technology?
How do you interface a mcu with other peripherals?
Computer architecutre:
What is the memory hierarchy?
What are the different memories in a computer?
What is mcu, processor, peripheral?
What is the RISC machine? What is CISC?
What is an instruction cycle?
What instruction ?
Write a basic code for load store instruction?
How do you do that in arm?
How does the memory get mapped in the final.map file?
What is the boot strap loader?
Did you develop any boot strap loaders?
What is von neuman architecture?
What is harvard architecture?
Explain a 4 bit adder?
What is nMOS ?
What is pMOS?
What is push-pull?
What is open drain?
What is USB?
What is a spinlock ?
What is a semaphore ?
Explain a semaphore?
What is a binary semaphire and what is a counting semaphore?
What is a mutex?
Where are mutexes used in common coding practises?
What is volatile type qualifier?
What is auto?
What is extern?
What is static ?how static ness can be used global spaces ?
What are pointers?
What is the usage of the pointers?
Can you give me an example of a fucntion pointer?
A fucntion which can pass and retrieve an array of funciton pointer?
What is a stack ?
What is a queue or ring buffer?
How do you know if a buffer is circular?


STM32 GPIO Push button LED blink. Easy Code snippets part - I

Board: Discovery STM32F4VGxx
Code Generated through: ST Cube MX. 

I generated the code with Cube MX. 

The GPIO pins are given in the STM Discovery Manual: 
http://www.st.com/content/ccc/resource/technical/document/user_manual/70/fe/4a/3f/e7/e1/4f/7d/DM00039084.pdf/files/DM00039084.pdf/jcr:content/translations/en.DM00039084.pdf


These are the config thing for clock:


Next is the code that you can put in the while loop to get GPIO toggleon Push button: 


if ( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )
{
HAL_GPIO_WritePin( GPIOD, GPIO_PIN_14, GPIO_PIN_SET );
}
else
       {
HAL_GPIO_WritePin( GPIOD, GPIO_PIN_14, GPIO_PIN_RESET );
}

Now compile and download the code. 

Done.. 

STM link Device not found.

Problem with STMLink.

Are you having an issue with the com led blinking on the ST link side?

STM Link  not detected through Keil or any other program that you using.
Well I have googled my way to debug this problem.
I think the interface is pretty much fool proof.

There are certain things that might cause this, but most of the times it is not the board. Just trust the board for now, and start questioning how you got into this situation ( well this is the first thought a embedded system debugger, because the Micro controller listens to what you say ). I spent crashing my head for couple of hours but my dejavu sense kind of kicked in and I was able to figure out easily. But in case if you are on road or already crossed this road, I am happy please share your story. 

There might be these reasons:
1. faulty cables. - This might be one of the reasons of the failure. Chance are the USB wire worn on out or some thing like.
I would advice you to change that. Get a new cable and try that out. But before running to a friend to get one check out the next reason. 
( I have swapped the cable that I used for my camera ).

2. Driver Issue. - The driver kind of gets screwed up some time.
Go to device manager and check if the USB device has loaded or not.
Re-start might work.
Or try it on a new machine.

3. Power Supply: If things gets this bad:
First thing if you are a starter change the board dont spend too much time. 8$ is not worth than your valuable time you waste around doing stuff that might not work at the end or end up frying other stuff.
(or)
If you are a serious dude and want to get the thing working there is a wikia page. I tried what ever they said, but I could not get it working.