Error 340 File '.c' not found

General discussion on mikroC PRO for ARM.
Post Reply
Author
Message
PoleAco
Posts: 16
Joined: 26 Jan 2015 12:23

Error 340 File '.c' not found

#1 Post by PoleAco » 26 Jan 2015 14:14

Hello all,

I apologize for my ignorance, I am trying to familirize with my STM32 Clicker2 and USB UART click.

I try to adapt the example but it won't build properly :

char uart_rd;

void main() {
UART3_Init(9600); // Initialize UART module at 56000 bps
Delay_ms(100); // Wait for UART module to stabilize

UART3_Write_Text("Start");
UART3_Write(13);
UART3_Write(10);

while (1) { // Endless loop
if (UART3_Data_Ready()) { // If data is received
uart_rd = UART3_Read(); // read the received data
UART3_Write(uart_rd); // and send data via UART
}
}
}

When buildin I get always :
0 340 File '.c' not found
0 102 Finished (with errors): 26 janv. 2015, 14:03:48 UART_Test.mcpar

I don't know what I am doing wrong.
Any input appreciated !

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: Error 340 File '.c' not found

#2 Post by marina.petrovic » 27 Jan 2015 13:23

Hi,

Probably you didn't create your project properly (you do not have source file properly included).

You can start from existing example, for example one written for LM3S9B95 MCU and then adjust it:
- Change MCU in your project
- Change clock and Project Settings (Project -> Edit Project).
You can use project settings from existing examples written for Clicker 2 for STM32.
Open example, go to Project -> Edit Project -> Save Scheme, then open your project and go to
Project -> Edit Project -> Load Scheme to load scheme/project settings which you previously saved.
- Change UART module to corespondent to Rx and Tx lines connected with mikroBUS socket which you use on
Clicker 2 for STM32 board.
- You can keep UART baud rate on 56000.
- Test your code with USART Terminal.

Best regards,
Marina

PoleAco
Posts: 16
Joined: 26 Jan 2015 12:23

Re: Error 340 File '.c' not found

#3 Post by PoleAco » 27 Jan 2015 14:43

Thank you for your answer.

For my understanding, how can I check whether all files are included ? (for example the *.c file does appear under sources in the project manager)
Also, how can I properly include the source file ?
For reference, creating a project from scratch and leaving it blank leads to the same 340 error when building.

I did as you advised I have opened the UART.mcpar example in EasyMx PRO v7 for Stellaris - LM3S9B95
and tried to compile it without changing it at all (not altering MCU or anything), except checking software debug build type.

Here is what I get when trying to build :

0 122 Compilation Started Compilation Started
1 402 ; expected, but ''t open "cpp.err"' found ; expected, but ''t open "cpp.err"' found
1 312 Internal error '' Internal error ''
0 102 Finished (with errors): 27 janv. 2015, 14:29:25 UART.mcpar

I don't understand the error message.

PoleAco
Posts: 16
Joined: 26 Jan 2015 12:23

Re: Error 340 File '.c' not found

#4 Post by PoleAco » 27 Jan 2015 15:09

OK.

For some reason, the MicroC Pro for ARM compiler works ONLY when launched with admin rights.

I did that and it solved this.

My thoughts :
-There is probably a good reason for that, but it is not "normal"
-I did not see about that on the provided documentation (I can have missed it though)
-The error message I got did not allow to understand the error or its cause, nor to correct it

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: Error 340 File '.c' not found

#5 Post by marina.petrovic » 28 Jan 2015 14:10

Hi,

Like I mentioned in my answer via our support desk, indeed maybe situations with administrator privileges
is not well documented.

In any case behavior which you have is very unusual because administrator privileges shouldn't affect
source file or missing a source file.
This error message can occurs, for example in situation when you first time create a New Project, you didn't save
it and then next time when you open a compiler, it open a previous project automatically (in which source/main file is missing).

Best regards,
Marina

Post Reply

Return to “mikroC PRO for ARM General”