This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center。
6年前关闭。
我为Tricore控制器编写了一个C程序,在编译之后,我得到了下面的错误消息,实际上我无法理解你能给我一些建议吗?
我可以猜测它与内存层次结构有关,但仍然无法找出实际的问题。
代码:
备注:代码是为TC1797微控制器编写的。
6年前关闭。
我为Tricore控制器编写了一个C程序,在编译之后,我得到了下面的错误消息,实际上我无法理解你能给我一些建议吗?
我可以猜测它与内存层次结构有关,但仍然无法找出实际的问题。
Error Messages:
ltc I455: requirement: 193K (0x304c8) bytes of RAM area in space spe:tc:linear
amk E451: make stopped
ltc I456: section type: group restriction - clustered
ltc I457: .bss.Pro2.group (60) (0x30140 bytes)
ltc I457: .bss._dbg_request.libcs_fpu (418) (0x14 bytes)
ltc I457: .bss.Pro2.rocount (61) (0x2d4 bytes)
ltc I457: .bss.stdin_buf.libcs_fpu (273) (0x50 bytes)
ltc I457: .bss.stdout_buf.libcs_fpu (274) (0x50 bytes)
代码:
/*
============================================================================
Name : hough.c
Author :
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define M 4
#define N 4
#define PI 3.14159265
typedef struct point {
int x;
int y;
} point;
typedef struct points {
point points[M * N];
double ro;
int pointCount;
} points;
int image[M][N] = { { 1, 1, 0, 1 }, { 1, 1, 0, 1 }, { 1, 1, 1, 1 },
{ 1, 0, 0, 0 } };
int i, j, k;
points group[181][M * N / 2];
int rocount[181];
int compare_float(double f1, double f2) {
float precision = 0.000001;
if (((f1 - precision) < f2) && ((f1 + precision) > f2)) {
return 1;
} else {
return 0;
}
}
void insert(double ro, int x, int y, int angle) {
int loopcount;
int roflag = 0;
if (rocount[angle] == 0) {
group[angle][rocount[angle]].ro = ro;
group[angle][rocount[angle]].pointCount = 0;
group[angle][rocount[angle]].points[group[angle][rocount[angle]].pointCount].x =
x;
group[angle][rocount[angle]].points[group[angle][rocount[angle]].pointCount].y =
y;
group[angle][rocount[angle]].pointCount++;
rocount[angle]++;
} else {
for (loopcount = 0; loopcount < rocount[angle]; loopcount++) {
if (compare_float(group[angle][loopcount].ro, ro)) {
roflag = 1;
group[angle][loopcount].points[group[angle][loopcount].pointCount].x =
x;
group[angle][loopcount].points[group[angle][loopcount].pointCount].y =
y;
group[angle][loopcount].pointCount++;
break;
}
}
if (roflag == 0) {
group[angle][rocount[angle]].ro = ro;
group[angle][rocount[angle]].pointCount = 0;
group[angle][rocount[angle]].points[group[angle][rocount[angle]].pointCount].x =
x;
group[angle][rocount[angle]].points[group[angle][rocount[angle]].pointCount].y =
y;
group[angle][rocount[angle]].pointCount++;
rocount[angle]++;
}
}
}
int main(void) {
double ro;
point x1;
for (k = -90; k <= 90; k++) {
rocount[k + 90];
for (i = 0; i < M; i++) {
for (j = 0; j < N; j++) {
if (image[i][j] == 1) {
ro = (i + 1) * cos(k * (PI / 180))
+ (j + 1) * sin(k * (PI / 180));
insert(ro, i + 1, j + 1, k + 90);
}
}
}
}
for (k = -90; k <= 90; k++) {
for (i = 0; i < rocount[k + 90]; i++) {
printf("\n Angle :%d RO:%f \n", k, group[k + 90][i].ro);
for (j = 0; j < group[k + 90][i].pointCount; j++) {
printf("(x:%d,y:%d)", group[k + 90][i].points[j].x,
group[k + 90][i].points[j].y);
}
}
}
return EXIT_SUCCESS;
}
备注:代码是为TC1797微控制器编写的。
最佳答案
我不知道Tricore控制器,但看起来你已经超出了一些限制我假设这个控制器的资源非常有限,并且生成过程检查您没有超过它们。requirement: 193K (0x304c8) bytes of RAM area in space spe:tc:linear
一定是说你用了193K的东西,太多了。.bss.Pro2.group (60) (0x30140 bytes)
意味着大部分来自BSS部分(即静态未初始化变量)。
我没有计算,但是points group[181][M * N / 2];
的大小可能是主要问题。
关于c - 请对Tasking Tricore Compiler显示的以下错误提出建议,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14152056/
10-11 18:30