Expected expression error in keil uvision (Tiva C Arm/ TM4C123GH6PM) - embedded

void PortF_Init(void){
SYSCTL_RCGC2_R |=(1<<5);
while((SYSCTL_PRGPIO_R&0x00000020)==0){}
GPIO_PORTF_LOCK_R =0x4C4F434B ; // Lock register .
GPIO_PORTF_CR_R =0XFF ; // Commit register .
GPIO_PORTF_DIR_R =0x0E ; // PF0 and PF4 input To control SW1,SW2.
GPIO_PORTF_DEN_R =0xFF ; // Enabling all pins
GPIO_PORTF_PUE_R =0X11 ;
}
Hi,
I am trying to do a sleeping led project on my tiva c card and I addressed the pins correctly but I get an error only in the part above. The error says "expected expression". Do you have an idea why am I getting this error?
Thanks.
I have checked the addresses and syntax error but I couldn't find any.

Related

At which address is qemu expecting to find the image?

I'm working with the qemu riscv32 emulator. I have managed to boot a simple hello-world image I have got from github, however I haven't managed to boot my own image. I suspect this is because I built my image without a linker script, therefore it is being loaded at the wrong address. I'm trying to understand how the qemu boot sequence works to fix this.
This is the linker script I'm using
OUTPUT_ARCH( "riscv" )
OUTPUT_FORMAT("elf32-littleriscv")
ENTRY( _start )
SECTIONS
{
/* text: test code section */
. = 0x20400000;
.text : { *(.text) }
/* gnu_build_id: readonly build identifier */
.gnu_build_id : { *(.note.gnu.build-id) }
/* rodata: readonly data segment */
.rodata : { *(.rodata) }
/* data: Initialized data segment */
. = 0x80000000;
.data : { *(.data) }
.sdata : { *(.sdata) }
.debug : { *(.debug) }
. += 0x1000;
stack_top = .;
/* End of uninitalized data segement */
_end = .;
}
And this is the qemu command I'm executing:
qemu-system-riscv32 -nographic -machine sifive_e -bios none -kernel hello
# with -s -S when debugging
The source code is not very relevant, it is just a small assembly file that writes "hello".
My main question is:
How can I know at which address is qemu expecting to find the image?
Other questions I would like to answer:
With gdb, I have noticed that qemu starts executing at address 0x1004 (before me doing anything). I was expecting it to be 0x0. Why is this?
I have read hat qemu can use U-boot. Does it use it, or any other bootloader, by default?
If so, is there any way to load an image at address 0x0 without any sort of bootloader intervening? (I ask this for debugging purposes, because the first time you try a new arch. possibly yo want to keep everything as simple as possible)
Does the kernel option just load the provided image, or does it something more? (like loading a Linux kernel and execute the provided image on top of it)
I'm using the sifive_e emulator, therefore I have gone to the SiFive E series datasheet (like this one ) to check the memory map, and find the starting address. This is what I have found:
Those address are very different from those specified in the linker script above. It seems I'm looking at the wrong place, where can I found the SiFive E boot address?
EDIT
With regards to the last question about the memory map, I found the answer. It is explained here (5.16) and here (chapter 6)

Flash memory failure

I'm working on a XScale PXA270 with NOR Flash on Chip select 0.
due to the obsolescence of the previous flash, my company change it for an AMD/Spansion compatible MX29GL128.
I'm trying to write on it using Lauterbach JTAG.
here is my script : https://pastebin.com/jcjsbwE3
; reset the FLASH declaration
FLASH.CFI 0x00000000 L
; declare FLASH sectors via
; CFI query
;FLASH.CHANGEtype ALL AM29F100
; change type to AM29F100 to use "word wise" mode
FLASH.UNLOCK ALL
; unlock FLASH if required
FLASH.ReProgram ALL
; enable the FLASH for programming
;Data.LOAD.auto /home/lai/devel/uboot-2017-01/u-boot.bin
Data.LOAD.binary /tftpboot/u-boot-rioms-pxa270.bin D:0x00000000--0x1FFFF
; load the programming file
FLASH.ReProgram off
; program the FLASH and disable
; the FLASH programming
But get an error.
Flash programming error around address SD:0x7C.
On this picture, you can see the commands on the bus and the error.
Have you some idea ? I'm stuck on it since many days

yaml-0.2.7 GetNextDocument() hit assertion fail in Scanner::peek

yaml-cpp team and everyone,
Our product receives an unfixed size of json response from a cloud service provider. We currently used a buffer with 16KB initial size to receive it, then pass it to yaml parser(we are using yaml-0.2.7). We expect yaml parser to throw an exception if the json document is incomplete during parsing and we will double the size of the buffer.
Today, we hit an assertion which shows "Assertion failed: (!m_tokens.empty()), function peek, file .../yaml-cpp-0.2.7/src/scanner.cpp, line 41." when doing parser.GetNextDocument(doc). The json document was incomplete due to small receiving buffer.
After examining the buffer and doing some experiment, I found out if some characters are missing following a certain pattern, the assertion in scanner will be hit during GetNextDocument. Such as for '{"access": "abc"}', if the last '}' is missing, then the assertion will be hit. Same thing happens if it is '{"access":' or '{"access"'. It will not hit the assertion if it is '"{"access":"abc' (note abc does not have the trailing double quote).
Will it help if I upgrade to the latest 0.5.3 version? I looked at the source code and saw the same assertion in Scanner::peek function is still there.
Here is the source code of the function where assertion is hit:
Token& Scanner::peek() {
{
EnsureTokensInQueue();
/** THIS ONE GOT HIT **/
assert(!m_tokens.empty()); // should we be asserting here? I mean, we really just be checking
// if it's empty before peeking.
#if 0
static Token *pLast = 0;
if(pLast != &m_tokens.front())
std::cerr << "peek: " << m_tokens.front() << "\n";
pLast = &m_tokens.front();
#endif
return m_tokens.front();
}
Much appreciate for the help! :)
This is fixed in 0.5.3, although I'm not sure when precisely it was fixed. I added tests for your examples and they pass (by throwing exceptions) as expected.

Prestashop Maintenance mode error

First things first I am new to Prestashop.
I have two issues. First is when I'm in the maintenance mode and I add my ip adres to gain access, I still can't access my frontoffice. This gives server error in my Chrome Browser.
But the bigger issue is when I turn the Maintenance mode off (and deleting my IP adress from the list) There is nothing. Just a blank screen. After a little research I found how to turn the error reporting on in defines.inc.php like this:
/* Debug only */
define('_PS_MODE_DEV_', true);
After this I got this error(s):
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/home/.sites/78/site58/web/modules/categoriesbar/category-bar-level.tpl" on line 8 "{include file=$tpl_dir./category-tree-branch.tpl node=$child last='true'}" - Unexpected "/", expected one of: "{" , "$" , "identifier" , INTEGER' in /home/.sites/78/site58/web/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:665 Stack trace: #0 /home/.sites/78/site58/web/tools/smarty/sysplugins/smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 /home/.sites/78/site58/web/tools/smarty/sysplugins/smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(40, '/') #2 /home/.sites/78/site58/web/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(40, '/') #3 /home/.sites/78/site58/web/tools/smarty/sysplugins/smarty_internal_t in /home/.sites/78/site58/web/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 665
any help would be appreciated :)
P.S.
I upgraded the Prestashop from 1.2.x to the 1.5.4 version...
Maybe it has something to do with this?
The error tells you there is an error in the template. Try changing the line to
{include file="$tpl_dir./category-tree-branch.tpl" node=$child last='true'}

Arduino Errors with sainsmart sheild

http://pastebin.com/86JXkUBf
This is my Arduino code that I am using as a status indicator for me and my roommate. The code as working completely fine until I decided to be able to edit the first line on the display, which is the sainsmart LCD keypad shield. Now, when I verify the code in the arduino IDE, i get the following set of errors:
sketch_jul22b.cpp:15:81: error: expected unqualified-id before '\x593a'
sketch_jul22b.cpp:15:81: error: expected ‘}’ before '\x593a'
sketch_jul22b.cpp:15:81: error: expected ‘,’ or ‘;’ before '\x593a'
sketch_jul22b.cpp:15:88: error: expected declaration before ‘}’ token
I would appreciate it very much if somebody would tell me:
1) what these errors mean.
2) How to resolve them.
Thanks!
corrected code that compiles.
http://pastebin.com/j5B37UUP
#praks411 was correct, but there were some typo's and need to use lcd.print instead of lcd.write.
I'm not sure exactly which line you have edited but looking at your code it seems to me that the status String must be in double quotes. Also there should be , instead of . after "Awesomeness"
So instead of
String top[] = {'Status:', 'Adam:', 'Oliver:', 'Adam & Oliver:', 'Awesomeness'. 'OBEY:'};
You should have
String top[] = {"Status:", "Adam:", "Oliver:", "Adam & Oliver:", "Awesomeness", "OBEY:"};