Open K4rolis opened 8 years ago
Today I tried compiling Basic_rBoot sample and I also get this error:
~/git/SmingRtosOff/samples/Basic_rBoot$ make rebuild
OC out/build/libmain2.a
make -C /home/klemen/git/SmingRtosOff/sming/rboot
make[1]: Entering directory '/home/klemen/git/SmingRtosOff/sming/rboot'
CC rboot-stage2a.c
LD /home/klemen/git/SmingRtosOff/samples/Basic_rBoot/out/build/rboot-stage2a.elf
E2 /home/klemen/git/SmingRtosOff/samples/Basic_rBoot/out/build/rboot-hex2a.h
CC rboot.c
LD /home/klemen/git/SmingRtosOff/samples/Basic_rBoot/out/build/rboot.elf
E2 /home/klemen/git/SmingRtosOff/samples/Basic_rBoot/out/firmware/rboot.bin
make[1]: Leaving directory '/home/klemen/git/SmingRtosOff/sming/rboot'
C+ app/application.cpp
CC /home/klemen/git/SmingRtosOff/sming/rboot/appcode/rboot-bigflash.c
CC /home/klemen/git/SmingRtosOff/sming/rboot/appcode/rboot-api.c
AR out/build/app_app.a
LD out/build/app_0.out
out/build/libmain2.a(app_main.o): In function `user_init_task':
(.irom0.text+0x580): undefined reference to `user_rf_cal_sector_set'
out/build/libmain2.a(app_main.o): In function `flash_data_check':
(.irom0.text+0x655): undefined reference to `user_rf_cal_sector_set'
collect2: error: ld returned 1 exit status
/home/klemen/git/SmingRtosOff/sming/Makefile-rboot.mk:334: recipe for target 'out/build/app_0.out' failed
make: *** [out/build/app_0.out] Error 1
This is very strange sinc eI know I compiled this succesfully before.
For me I needed to change main.cpp to this:
#include "espressif/esp_common.h"
#include "sming/include/sming_config.h"
//#include "sming/include/SmingCore.h"
extern void init();
extern "C" void __attribute__((weak)) user_init(void)
{
printf("Sming RTOS Proof of Concept \r\n");
printf("SDK version:%s\n", system_get_sdk_version());
printf("FreeHeapSize = %d\r\n",xPortGetFreeHeapSize());
init();
}
extern "C" uint32 ICACHE_FLASH_ATTR
user_rf_cal_sector_set(void)
{
//enum
flash_size_map size_map = system_get_flash_size_map();
uint32 rf_cal_sec = 0;
switch (size_map) {
case FLASH_SIZE_4M_MAP_256_256:
rf_cal_sec = 128 - 5;
break;
case FLASH_SIZE_8M_MAP_512_512:
rf_cal_sec = 256 - 5;
break;
case FLASH_SIZE_16M_MAP_512_512:
case FLASH_SIZE_16M_MAP_1024_1024:
rf_cal_sec = 512 - 5;
break;
case FLASH_SIZE_32M_MAP_512_512:
case FLASH_SIZE_32M_MAP_1024_1024:
rf_cal_sec = 1024 - 5;
break;
default:
rf_cal_sec = 0;
break;
}
return rf_cal_sec;
}
// For compatibility with SDK v1.1
extern "C" void __attribute__((weak)) user_rf_pre_init(void)
{
// RTC startup fix, author pvvx
volatile uint32 * ptr_reg_rtc_ram = (volatile uint32 *)0x60001000;
if((ptr_reg_rtc_ram[24] >> 16) > 4) {
ptr_reg_rtc_ram[24] &= 0xFFFF;
ptr_reg_rtc_ram[30] &= 0;
}
}
notice: extern "C" uint32 ICACHE_FLASH_ATTR instead of uint32 ICACHE_FLASH_ATTR as it is mentioned in @K4rolis post above.
@zhivko : If you create a PR I will merge
@hreintke what about the errno.h thing? Or am I doing something wrong? And also, was the method I used the correct method to fetch the required RTOS SDK?
@hreintke ok will do that, but how Basic_rBoot sample works for you with upper error - sorry maybe missing a point here.
@hreintke it will be hard for me to create pull request since my SmingRTOS includes some additional features. But here is diff.
Hi,
Before reading further, please keep in mind that I'm really new at this.
What is the correct procedure (starting from scratch) to compile a sample application? Let's say I'm interested in the Basic_Serial.
Steps that I have followed:
git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
make STANDALONE=n
git clone https://github.com/espressif/ESP8266_RTOS_SDK.git --branch 1.3.x --single-branch
git clone https://github.com/SmingHub/SmingRTOS.git
cd $SMING_HOME && make
Problem 1: JsonVariant.cpp is referring to errno.h that no longer exists, uncommenting line 13 and commenting line 12 seems to fix itcd $SMING_HOME/../samples/Basic_Serial/ && make
:What did I miss? Am I using incorrect RTOS SDK version? Adding code from here to user_main.cpp seems to fix the build issue, is this the correct way of solving this? If so, why hasn't this been submitted to the repo?
My apologies if the formatting is less-than-ideal - this is my first message on GitHub ever!
Karolis