Windows error 0x000000CD, 205

Detailed Error Information

NO_SIGNAL_SENT[1]

MessageNo process in the command subtree has a signal handler.
Declared inwinerror.h

This appears to be a raw Win32 error. More information may be available in error 0x800700CD.

PAGE_FAULT_BEYOND_END_OF_ALLOCATION[2]

This is a Blue Screen of Death stop code. More information is available in the Knowledge Base article Bug Check 0xCD: PAGE_FAULT_BEYOND_END_OF_ALLOCATION.

HRESULT analysis[3]

This is probably not the correct interpretation of this error. The Win32 error above is more likely to indicate the actual problem.
FlagsSeveritySuccess

This code indicates success, rather than an error. This may not be the correct interpretation of this code, or possibly the program is handling errors incorrectly.

Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode0 (0x000)
NameFACILITY_NULL[3][1]
DescriptionThe default facility code.[3][1]
Error Code205 (0x00cd)

Possible solutions

1

High Performance Bare Metal Abstraction

c++
templates
arm
embedded
bare-metal

Sorry, but it's difficult to understand what you actually need. If I understand you correctly you need a generic way to get an offset in specific structure out of a pointer provided by the third party headers (assuming you know the alignment of the structure). If you claim you can achieve your goal with C++11 constexpr functions, try to use templates for C++03.

I suppose you need to introduce a higher level wrapper that converts pointer into offset:

template <typename T, T ptr, unsigned TAlignmentMask>
struct AddrRetriever
{
    static const int value = (int)ptr & TAlignmentMask;
}

And then use:

typedef Periphery<
    AddrRetriever<
        volatile void*, // use the type of the pointer vendor provides
        PTR_FROM_VENDOR, 
        KNOWN_ALIGNMENT_MASK>::value
 > Periphery0;

As a side note, I'd like to recommend reading Practical Guide to Bare Metal C++. It will give you some ideas on implementing generic asynchronous timers, uarts, and other peripherals just like you want.

answered on Stack Overflow Feb 16, 2016 by Alex Robenko
1

Arithematic operation of Fixed point with Std_logic_vector in VHDL

floating-point
hex
vhdl
fixed-point
xilinx-ise

If you can use z <= x - y directly, it sounds like you are use one of the Synopsys packages like ieee.std_logic_unsigned, but instead you may consider using the VHDL standard package ieee.numeric_std, which is used in the example below.

The std_logic_vector does not by default have any numeric representation; it is just an array of std_logic. The unsigned type in ieee.numeric_std package can indicate a numeric representation of a std_logic_vector doing unsigned(x). So the above expression using unsigned subtraction will be:

z <= std_logic_vector(unsigned(x) - unsigned(z));

Any underrun/overrun, as with "z = 0x01-0x11", will result in wrapping without any indication.

answered on Stack Overflow May 26, 2015 by Morten Zilmer
1

Arithematic operation of Fixed point with Std_logic_vector in VHDL

floating-point
hex
vhdl
fixed-point
xilinx-ise

I think your question needs some refinement. I don't know why it's tagged verilog, the hexadecimal numbers you've shown are not signed, and std_logic_vector is not arithmetic in the first place (adding such interpretation is done with std_logic_arith or similar, but it's preferable to use unsigned and signed from numeric_std). As such, there must be more to your code for the subtraction to even work, and the negative numbers shown must be from something else; a simulator, perhaps? Simulators and waveform viewers tend to have their own settings for how to interpret signals.

So, expand your sample to show the environment you're using, and explain what operation you're actually seeking. Did you mean to take the absolute value of the difference, or use saturated arithmetic?

answered on Stack Overflow May 26, 2015 by Yann Vernier
0

High Performance Bare Metal Abstraction

c++
templates
arm
embedded
bare-metal

You should always create a hardware abstraction layer around the hardware peripheral. Meaning that the caller shouldn't need to know or care about the bits and bytes of the registers. In other words, make a standard hardware driver for a given peripheral on a given MCU.

To handle multiple hardware peripherals of the same type, on the same chip, you usually take the first register's address as a parameter to keep them apart. It seems this is what your code is doing.

To take the abstraction level further, you can then create an abstract base class "UART", which holds generic functions for all UARTs, such as setup baudrate and communication format, setup hardware handshaking if needed, send, receive and so on. All your UART drivers will then have to inherit the base class function interface.

Then the caller of the application doesn't need to know or care about how a specific hardware peripheral works on the given MCU. The caller application will be completely portable.

This is the standard way to do professional firmware design. Usually it is done in C, but with some care is will be possible to do in C++ as well, without creating too much dead weight (avoid templates).

answered on Stack Overflow Feb 16, 2016 by Lundin

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-code-reference2
  3. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0