Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [stack]

Anything related to hardware and software stacks, i.e. data structures managed using a LIFO (Last-In First-Out) policy.

2
votes
4answers
97 views

How can we determine memory usage of a microcontroller

How can we determine how much memory is being used, or will be used by firmware in a microcontroller? What tools can support this? Generally we don't use dynamic memory in embedded systems, but how ...
2
votes
1answer
298 views

Main Stack Pointer(MSP) vs Process Stack Pointer(PSP)

I was reading the STM32 Programming manual and somewhere on "page 18 " i see these two kind of stack pointers. I always think that there is only ONE stack and therefore only ONE stack pointer to that ...
0
votes
1answer
73 views

Stack overflow results

I have been forcing a problem regarding to corruption of the MCU flash memory content during software running. This corruption occurs randomly and I have got an idea whether the flash memory ...
0
votes
2answers
581 views

How does an “if” statement and “always@” statement work in Verilog?

I'm trying to program an 8 level stack register for a Program Counter. It is working well enough, but for some reason, when I test it, some combinations of inputs produce unexpected results. This is ...
0
votes
0answers
51 views

Best way to attach a new pcb inbetween an existing board and a bga chip

The idea is to slice a board between a laptop chipset and the motherboard to get access to pcie channels that were left to float. What would be the best way to pass the original high speed ...
0
votes
2answers
85 views

Existence (or reason of lack) of simple cmos LIFO registers IC

There's a project I'm working on that needs a simple LIFO register. What I mean by simple is to support the PUSH & POP operations, and I guess EMPTY and FULL indicators. I must be searching with ...
2
votes
1answer
474 views

Power Supply Stacking in Parallel

I have two DLM 60-10 Sorenson bench power suppllies (10A limit) that I am wanting to stack in parallel so that I can provide between 1 and 20 A, at a consistent 12 V. I'm not particularly an ...
3
votes
2answers
1k views

Must FreeRTOS task stack size account for interrupt stack size?

I have FreeRTOS running on a MKE06 Cortex-M0+ (based on SAMD20 demo), GCC toolchain. I am trying to figure out optimal task stack sizes (with the help of avstack.pl). I want to use only static memory ...
1
vote
2answers
557 views

Preventing Stack overflows in PIC MCU using C language MPLAB X

I am writing a C language code for PIC16f877a for an Alarm clock. In short, the alarm clock shows Time, Set alarm and a temperature & humidity reading on an LCD. I have written interrupts for ...
-3
votes
2answers
458 views

Manually storing the stack pointer rather than using push and pop (Assembly)

What will be the instruction sequence that implements PUSH R4? A: SUB SP, SP, #4 STR R4, [SP, #0] B: ...
0
votes
1answer
203 views

Confusion on pop for recursive assembly code

I'm confused on what happens during POP. When POP LR happens does that change the PC to the location of ...
1
vote
1answer
1k views

What happens If the interrupt occurs during the execution of HALT instruction?

Consider the following program segment on a hypothetical processor . I have this question in my course CS201. Suppose this processor has 32 bits Load/Store operations, ALU operations is 16 bits and ...
0
votes
0answers
275 views

Design a stack-machine in RTL

Im trying to draw an RTL-design based on this photo and the following requirements: Select an RTL basic block which can provide the memory for the stack. Sketch the RTL which selects the top-of-stack ...
0
votes
1answer
379 views

stack calculation in microcontroller

I have written a program to estimate the stack usage in the following manner I have defined a global pointer variable to unsigned char. I have defined a local variable in the main program and have ...
3
votes
0answers
3k views

How to know the memory occupied by the various memory segments in a microcontroller

I'm using STM32 based microcontroller, IAR embedded workbench and STlink v2 debugger. I just want to know how to check the memory utilized/used by the program/system in various memory segments like: ...
2
votes
2answers
1k views

Is there stack available in PIC ISRs?

I'm trying to better understand the interaction between the foreground (interrupt) and background (while (1)) loops in a PIC microcontroller. Specifically, a ...
0
votes
1answer
388 views

Context switching and systick handling on the STM32F series

I am using a STM32F407 board to build my own tiny RTOS and I have some questions. How can I define my own stack in different memory location, so I can have one stack for each queue of tasks? How do I ...
-4
votes
2answers
2k views

scheduler and stack

i develop my own scheduler on stm32f407 board i have different queues of tasks with different priorities and frequencies i want to mange stack operations myself when in SysTick_Handler event each ...
3
votes
1answer
698 views

stack implementation in 8051

I have a doubt on stack implementation in 8051 and I don't even know if I'm asking it in right way so please pardon me. I've been reading stack implementation in 8051 and many textbooks and references ...
4
votes
1answer
804 views

Does MPLAB X have a call-graph analysis tool?

I'd like to start understanding how deep my microcontroller's stack goes (even if it's only an estimation). How can I do this using MPLAB X?
3
votes
4answers
917 views

TRUE/FALSE or true/false?

In resource-constrained systems (like an 8-bit PIC), is there any benefit to using your own macros for true and false as opposed to using those defined from stdbool? ...
2
votes
2answers
1k views

How does the Array allocated in the stack?

I was testing the code below on my STM32 board, but I could't understand how the array was being allocated in the stack. I'm assuming that there are 200 bytes of memory in STM32. Here is the code: <...
4
votes
2answers
351 views

Why are communciation protocols presented as Stacks (vertical) rather than as a conveyor belt (horizontal)?

The OSI model and other models represent a communication system as a stack of multiple layers. In this case we get a vertical structure where "user" is at the top and the receiver of communication at ...
7
votes
6answers
3k views

Exploiting stack buffer overflows on an Arduino

Is it possible exploit stack buffer overflows on an Arduino board?
11
votes
3answers
2k views

What does it mean for a CPU to support a stack?

How can a CPU not support a stack? Doesn't any architecture that uses subroutines (I'm pretty sure that's all architectures) have to push the return address onto the stack so it can return to where it ...
5
votes
1answer
709 views

PIC24F Software Stack?

I know many of the lower-end PICs have fixed hardware stacks that can become an issue during firmware development. I've recently heard that the PIC24-series (and maybe just anything above PIC18 ...
4
votes
3answers
418 views

Is there any restriction in the choice of Ethernet PHY, depending on the TCP/IP stack?

I am new on the forum and am currently working on a project to design an ethernet electronic board. I will have a microcontroller 32-bit with an external PHY. I wanted to know : depending on the TCP/...
7
votes
3answers
3k views

How to implement simple stack switching in PIC12/16 cores?

I am trying to understand how real time operating systems work. I have looked at the source codes of some RTOSes. I want to learn by creating my simple RTOS, something like FLIRT. I am using PIC16 ...