The OP
Published on 2019-1-23 17:09
Only look at the author
This post is from stm32/stm8
Latest reply
for is written by myself, pure C language, it doesn't matter if it is not aligned, the compiler will do this, if it is not aligned, split it several times to read, if it is aligned, read 4 bytes at a time. The ARM library provides the highest efficiency, which should be the assembly instruction, plus several layers of encapsulation, and what you see is the memcpy in the library. Here is a passage in the authoritative guide of cortex-M3. . The long type is the same as int in keil arm, which is 4 bytes. [attach]400597[/attach]
Details
Published on 2019-1-25 11:25
| ||||
|
||||
2
Published on 2019-1-23 17:13
Only look at the author
This post is from stm32/stm8
Comments
Thanks, the basic positioning problem is about byte alignment. I have a few more questions, can you help me answer them? I found the cause of the problem, it is a byte alignment problem. Two relatively large arrays are defined in the project, as follows: __attribute__((aligned(4))) uint8_t MMU_US_Data_Memo
Details
Published on 2019-1-24 18:02
| ||
|
||
|
wenyangzeng
Currently offline
|
3
Published on 2019-1-23 17:13
Only look at the author
This post is from stm32/stm8
Comments
My understanding is that the order is different, just when compiling, but the final linked hex or bin file should be the same. As you said, the hardware is not initialized. This statement is not appropriate. For example, when writing code, no one will deliberately put the initialization file at the top.
Details
Published on 2019-1-23 17:52
My understanding is that the order is different, just when compiling, but the final linked hex or bin file should be the same. As you said, the hardware is not initialized. This statement is not appropriate. For example, when writing code, no one will deliberately put the initialization file at the top.
Details
Published on 2019-1-23 17:21
| |
|
||
|
4
Published on 2019-1-23 17:16
Only look at the author
| |
|
|
|
This post is from stm32/stm8
Comments
I think it has nothing to do with the order of the files, because when compiling, the compiler will automatically compile each function according to the program flow. The main reason may be that there is a problem with a function, but when running before, this function was not run, so the problem was not exposed.
Details
Published on 2019-1-23 22:34
| ||
|
||
|
This post is from stm32/stm8
Comments | ||
|
||
|
7
Published on 2019-1-23 17:25
Only look at the author
This post is from stm32/stm8
Comments | ||
|
||
|
This post is from stm32/stm8
| ||
|
||
|
This post is from stm32/stm8
| ||
|
||
|
10
Published on 2019-1-23 17:52
Only look at the author
This post is from stm32/stm8
| ||
Personal signaturehttp://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr |
||
|
tiankai001
Currently offline
|
11
Published on 2019-1-23 22:34
Only look at the author
This post is from stm32/stm8
Comments | |
|
||
|
12
Published on 2019-1-24 00:10
Only look at the author
This post is from stm32/stm8
Comments | ||
Personal signature
默认摸鱼,再摸鱼。2022、9、28 |
||
|
This post is from stm32/stm8
Comments | ||
|
||
|
This post is from stm32/stm8
| ||
|
||
|
15
Published on 2019-1-24 09:21
Only look at the author
This post is from stm32/stm8
| ||
Personal signature
默认摸鱼,再摸鱼。2022、9、28 |
||
|
16
Published on 2019-1-24 09:27
Only look at the author
This post is from stm32/stm8
赞赏 | ||
Personal signature坐而言不如起而行
|
||
|
17
Published on 2019-1-24 09:33
Only look at the author
This post is from stm32/stm8
Comments
I think your analysis is reasonable.
Details
Published on 2019-1-24 09:40
| ||
Personal signature坐而言不如起而行
|
||
|
tiankai001
Currently offline
|
18
Published on 2019-1-24 09:40
Only look at the author
This post is from stm32/stm8
Comments
I have encountered a similar problem to the one he mentioned. When I first saw it, I felt that C language might not work, and thought it should be C++. He is indeed talking about C++ below. I have done it once before. The class code remains unchanged, but the location of object initialization is different, which will cause problems.
Details
Published on 2019-1-24 09:51
| |
|
||
|
19
Published on 2019-1-24 09:45
Only look at the author
This post is from stm32/stm8
| ||
Personal signature模电临时工
|
||
|
20
Published on 2019-1-24 09:51
Only look at the author
This post is from stm32/stm8
Comments
Thanks, the basic positioning problem is about byte alignment. I have a few more questions, can you help me answer them? I found the cause of the problem, it is a byte alignment problem. Two relatively large arrays are defined in the project, as follows: __attribute__((aligned(4))) uint8_t MMU_US_Data_Memo
Details
Published on 2019-1-24 18:04
| ||
Personal signature坐而言不如起而行
|
||
|
论坛测评队员
在下载中心贡献超过4000份资料
EEWorld Datasheet Technical Support
EEWorld
subscription
account
EEWorld
service
account
Automotive
development
circle
About Us Customer Service Contact Information Datasheet Sitemap LatestNews
Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190