Weird Crash While Casting 4 Byte Data Array To Uint32_t #4330 - GitHub
Maybe your like
- Notifications You must be signed in to change notification settings
- Fork 13.3k
- Star 16.5k
- Code
- Issues 324
- Pull requests 75
- Discussions
- Actions
- Projects 0
- Wiki
- Security
Uh oh!
There was an error while loading. Please reload this page.
- Insights
Description
Basic Infos
Hardware
Hardware: Wemos D1 mini Core Version: 2.4.0
Description
Attached bellow a sketch were i am trying to cast a 4 byte data array to a 32 bit integer, but the system crashes. PS: Sketch contains .cpp and .h files
Settings in IDE
Module: ESP8266 Module Flash Size: 4MB CPU Frequency: 80Mhz Flash Mode: ?qio? Flash Frequency: ?40Mhz? Upload Using: SERIAL Reset Method: ?ck / nodemcu?
Sketch
Sketch has multiple files. Main
#include "test.h" My_Class test; void setup() { Serial.begin(256000); Serial.println("Start"); printf("%p \n",test.data); printf("%p \n",test.getDataPointer()); uint32_t temp = *((uint32_t *) test.getDataPointer()); Serial.println(temp); } void loop() { }test.cpp file
#include "test.h" uint8_t * My_Class::getDataPointer() { return data; }test.h file
#ifndef test_h #define test_h #include <Arduino.h> #include <string.h> class My_Class{ public: uint8_t * getDataPointer(); bool isValid; uint8_t data[4]={0x00,0x00,0x00,0x20}; }; #endifDebug Messages
2/8/2018 19:05:20.829 [RX] - ÀüÀ<<<<NUL>�À<<<NUL>�À<<NUL>�ü<ü<<NUL>�<À<À<NUL>�À<NUL>�<üÀ<NUL>�À<À<NUL>�ÀÀÀ<À<NUL>�À<NUL>�À<NUL>�<<NUL>�À<NUL>�ü<<<ü<À<ÀüÀÀ<NUL>�À<NUL>�üÀ<NUL>�<<NUL>�ÀÀÀ<ü<ü<üü<À<ÀÀüÀ<NUL>�À<<NUL>�À<<NUL>�ü<<NUL>�<Àü<ü<À<NUL>�À<<NUL>�À<ü<NUL>�<ü<<<À<<<üü<À<NUL>�À<NUL>�<ÀÀ<NUL>�À<ü<NUL>�À<ü<NUL>�<À<<<üü<À<NUL>�À<NUL>�<ÀÀ<NUL>�À<ü<NUL>�À<Àü<üÀü<NUL>�<<<<NUL>�<<NUL>�<<<<NUL>�<ÀÀ<<NUL>�À<À<ü<À<<Start<CR><LF> 0x3ffee999 <LF> 0x3ffee999 <LF><CR> <LF> Exception (9):<CR><LF> epc1=0x4020208f epc2=0x00000000 epc3=0x00000000 excvaddr=0x3ffee999 depc=0x00000000<CR><LF> <LF> ctx: cont <LF> sp: 3ffef840 end: 3ffefa10 offset: 01a0<CR><LF> <LF> >>>stack>>><LF> 3ffef9e0: feefeffe 3ffee998 3ffee9bc 40202088 <CR><LF> 3ffef9f0: 3fffdad0 00000000 3ffee9d8 40202514 <CR><LF> 3ffefa00: feefeffe feefeffe 3ffee9f0 40100108 <CR><LF> <<<stack<<<<LF>Metadata
Metadata
Assignees
No one assignedLabels
No labelsNo labelsType
No typeProjects
No projectsMilestone
No milestoneRelationships
None yetDevelopment
No branches or pull requestsIssue actions
You can’t perform that action at this time.Tag » Arduino Uint32_t To Byte Array
-
Convert Byte Array To Uint32_t - Arduino Forum
-
From Big Integer To Byte Array. - Arduino Forum
-
[SOLVED] Split Uint-32 To Bytes - Arduino Forum
-
Copy Int Array To Byte - Programming Questions - Arduino Forum
-
Converting Number To Byte Array - Stack Overflow
-
Long To Byte Array Help! : R/arduino - Reddit
-
Unexpected Results When Creating 32-bit Int From Byte Array
-
Arduino - Convert 4 X Uint8 To 1 X Uint32 - EEVblog
-
How To Cast Uint8_T Array Of 4 To Uint32_T In C - ADocLib
-
Working With Bytes | The Things Network
-
Data Types In Arduino - Sparkfun Learn
-
How To Convert Between Hexadecimal Strings And Numeric Types