u-boot mmc read_block limitiations - embedded

I am trying to copy a file from a MMC/SD card in a global variable (struct) of U-Boot SPL, which is in OCRAM. So far I am trying to use
mmc->block_dev.block_read(0, file_sector, 4, &my_struct);
Since copying to DRAM (DDR3/DDR4) works (if I replace &my_struct with an address in RAM, the call succeed and I can correctly read the file back from RAM), I am certain that my file is located at the beginning of sector file_sector.
However, with this code, I get:
ERROR: v7_dcache_inval_range - start address is not aligned - 0x100082f4
ERROR: v7_dcache_inval_range - start address is not aligned - 0x10008af4
Are there some requirements/limitations I should be aware off on the location of the destination of block_read ?

So, part of the answer is what it says right there in the error message. Where 'mystruct' is, is not cache aligned so the flushing that we do isn't valid. You should use the ALLOC_CACHE_ALIGN_BUFFER macro and as #LPs mentioned, be copying into a character buffer.

Related

Error accessing my.settings - corrupt user.config

I have a client who has asked me to fix a problem with a corrupt user.config file. The config file has enough of an XLM header for the program to load the settings, but the rest of the config file is nulls (0x00) so the config loads, but then an error occurs when attempting to access any of its member. Note: the 0x00 value pops up in the error message later.
After much research, the common suggested solution seems to be delete the user.config file and then do a My.Settings.Reset but this doesn't work for me. The only solution that seems to work is to delete the user.config file, and then shut down and restart the program. The program starts and runs fine after deleting the user.config file. It creates a new user.config with default values and goes on its merry way with no problems.
What I have tried:
First:
Dim innerExcept As ConfigurationErrorsException = CType(cex.InnerException, ConfigurationErrorsException)
My.Computer.FileSystem.DeleteFile(innerExcept.Filename)
Then various combinations of the following:
My.Settings.Reset()
My.Settings.Reload()
My.Settings.Upgrade()
No matter what I try, I get the following error. Any thoughts?
System.Configuration.ConfigurationErrorsException HResult=0x80131902
Message=Configuration system failed to initialize
[truncated for brevity]
Inner Exception 1: ConfigurationErrorsException: '.', hexadecimal
value 0x00, is an invalid character.

Capture image from oscilloscope and store on PC using LabVIEW

I am trying to remotely control an oscilloscope from Agilent (DSO-X 3034A) using LabVIEW. I want to take a screen capture and store it on the computer. I tried the following:
The commands inside the string are:
:SAVE:FILename "temp.png";:SAVE:IMAGe:FACTors ON;:SAVE:IMAGe:FORMat PNG;:SAVE:IMAGe:INKSaver OFF;:SAVE:IMAGe:STARt;
I get the following errors:
Thank you
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ EDIT ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I managed to save the image on the oscilloscope. I am currently trying to move it and save it on the computer instead. I tried the following:
However after writing the "HARDcopy" commands I get the following error:
Your header is undefined. Refer to the "Serial Communications" documentation in order to see what the instrument is expecting in the header. You should right click your string constant and do "\ Codes Display" so that if the documentation calls for a \n character, you're not accidentally sending a \ character followed by an n character.
Query Unterminated means you're not terminating the query as the instrument expects. It looks like you have a newline, but assuming you're using windows, it's possible that the instrument doesn't want the extra \r that is there by default. Again, you'll have to refer to the documentation to be sure.

DATASET_CANT_CLOSE error number 32 "Broken Pipe"

I experienced an error in SAP ABAP which says DATASET_CANT_CLOSE with error number 32 (Broken Pipe). Question is: what procedure triggered this kind of error?
As far as I know, this error was triggered by:
CLOSE DATASET dset
But I can't reproduce the error since I don't know what procedure does trigger this kind of error.
This is the code I use:
method GENERATE_TXT_FILE.
DATA :
lwa_data TYPE t_line,
lv_param TYPE sxpgcolist-parameters.
"Upload File to Server
*Open Dataset
OPEN DATASET im_file_name FILTER 'dos2ux'
FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
CLEAR lwa_data.
LOOP AT it_data INTO lwa_data.
CATCH SYSTEM-EXCEPTIONS file_access_errors = 4
OTHERS = 8.
TRANSFER lwa_data-lines TO im_file_name.
ENDCATCH.
IF sy-subrc <> 0.
CLEAR lwa_data.
EXIT.
ENDIF.
CLEAR lwa_data.
ENDLOOP.
*Close Dataset
CLOSE DATASET im_file_name.
As I have investigated through the background job log, it seems that the current server which run the background job haven't got mapped yet to the text file folder. Solution is to re-map the server to text file folder.
You are using the FILTER extension to OPEN DATASET - which can be a HUGE security issue as well as raise loads of portability issues unless you know what you're doing, but that's not what the question is about. From the documentation:
When the statement OPEN DATASET is executed, a process is started in
the operating system for the specified statement. When the file is
opened for reading, a channel (pipe) is linked with STDOUT of the
process, from which the data is read during file reading. The file
itself is linked with STDIN of the process. When the file is opened
for writing, a channel (pipe) is linked to STDIN of the process, to
which data is passed when writing. The output of the process is
diverted to this file.
In your case, the filter command probably decided to bail out - see this answer among many. Why is hard to investigate - you may have to go through various system logs to find out. If the problem really is some unmapped network folder, you could try switching to UNC paths.

Inconsistent Behavior In A Batch File's For Statement

I've done very little with batch files but I'm trying to track down a strange bug I've been encountering on a legacy system.
I have a number of .exe files in particular folder. This script is supposed to duplicate them with a different file name.
Code From Batch File
for %%i in (*.exe) do copy \\networkpath\folder\%%i \\networkpath\folder\%%i.backup.exe
(Note: The source and destination folders are THE SAME)
Example Of Desired Behavior:
File1.exe --> Becomes --> File1.exe.backup.exe
File2.exe --> Becomes --> File2.exe.backup.exe
Now first, let me say that this is not the approach I would take. I know there are other (potentially more straight forward) ways to do this. I also know that you might wonder WHY on earth we care about creating a FileX.exe.backup.exe. But this script has been running for years and I'm told the problem only started recently. I'm trying to pinpoint the problem, not rewrite the code (even if it would be trivial).
Example Buggy Output:
File1.exe.backup.exe
File1.exe.backup.exe.backup.exe
File1.exe.backup.exe.backup.exe.backup.exe
File1.exe.backup.exe.backup.exe.backup.exe.backup.exe
File1.exe.backup.exe.backup.exe.backup.exe.backup.exe.backup.exe
File1.exe.backup.exe.backup.exe.backup.exe.backup.exe.backup.exe.backup.exe
etc...
File2.exe.backup.exe
File2.exe.backup.exe.backup.exe
File2.exe.backup.exe.backup.exe.backup.exe
File2.exe.backup.exe.backup.exe.backup.exe.backup.exe
File2.exe.backup.exe.backup.exe.backup.exe.backup.exe.backup.exe
File2.exe.backup.exe.backup.exe.backup.exe.backup.exe.backup.exe.backup.exe
Not knowing anything about batch files, I looked at this and figured that the condition of the for statement was being re-evaluated after each iteration - creating a (near) infinite loop of copying (I can see that, eventually, the copy will fail when the names get too long).
This would explain the behaviour I'm seeing. And when cleaned the directory in question so that it had only the original File1.exe file and ran the script it produced the bug code. The problem is that I CANNOT replicate the behaviour anywhere else!?!
When I create a folder locally with a few .exe files and run the script - I get the expected output. And yes, if I run it again, I get one instance of 'File1.exe.backup.exe.backup.exe' (and each time I run it again, it increases in length by one). But I cannot get it to enter the near-infinite loop case.
It's been driving me crazy.
The bug is occurring on a networked location - so I've tried to recreate it on one - but again, no success. Because it's a shared network location, I wondered if it could have something to do with other people accessing or modifying files in the folder and even introduced delays and wrote a tiny program to perform actions in the same folder - but without any success.
The documentation I can find on the 'for' statement doesn't really help, but all of the tests I've run seem to suggest that the in (*.exe) section is only evaluated once at the beginning of execution.
Does anyone have any suggestions for what might be going on here?
I agree with Andriy M's comment - it looks to be related to Windows 7 Batch Script 'For' Command Error/Bug
The following change should fix the problem:
for /f "eol=: delims=" %%i in ('dir /b *.exe') do copy \\networkpath\folder\%%i \\networkpath\folder\%%i.backup.exe
Any file that starts with a semicolon (highly unlikely, but it can happen) would be skipped with the default EOL of semicolon. To be safe you should set EOL to some character that could never start a file name (or any path). That is why I chose the colon - it cannot appear in a folder or file name, and can only appear after a drive letter. So it should always be safe.
Copy supports wildcard characters also in target path. You can use
copy \\networkpath\folder\*.exe \\networkpath\folder\*.backup.exe

What is the number next to the method name in a stack trace?

I have a simple question, I suppose, but I cannot find anything.
What's the number at the end of line 6, + 429?
It means that the return address for stack frame 6 is 429 bytes past the start of the -[#### tableView:cellForRowAtindexPath:] function. It might be inside that function, or it might be past the end of the function but not inside any other known function.
UPDATE
In order for the symbolicator to turn those return addresses into line numbers, you must have the .dSYM file that the linker created when it created the executable file. Each executable is tagged with a UUID, and the .dSYM file is tagged with the same UUID. The symbolicator looks at the UUID of the executable and uses Spotlight (OS X's filesystem search support) to find the matching .dSYM. If you didn't save the .dSYM, you will have a hard time turning the addresses into line numbers. Note that when you tell Xcode to build an archive (Product > Archive), the archive contains both the executable and its matching .dSYM.